-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade nextjs #7066
Comments
- I am completely and totally stumped by next 14.x -- see #7066
Update: I reverted the upgrade to 13.5.6 since that might have caused weird problems. I don't know. |
I was just investigating our next.js version situation. Here it says 13.5.6, but actually we're lower. I found d2ceac6 explaining that. We should update that 13.4 line to |
I'm taking this over because we shouldn't wait weeks on this and it's important. |
(also it's going to be too painful for @schrodingersket who would have to chase all over to realize, e.g., that nextjs is also in the hub, etc.) |
Everything works fine on kucalc and the next page, but some of the proxying does NOT work in dev mode. I'll dive in and try to fix this. |
Actually, I just fully tested things and dev mode does work fine. There's a harmless error in the log about websocket upgrading happening twice, but it all works. I have a cocalc-docker dev VM and that is what is not working, so maybe it's an issue just with cocalc-docker, or maybe I just need to be more careful in my build. Will investigate further. In any case:
|
… websockets. - this fix took HOURS of reading the nextjs source code to figure out, but it's a good fix, and I improved our docs/comments a lot - I have to say... the nextjs source code is quite impressive in terms of quality!
OK, I fixed all the fallout caused by this, as far as I can tell. Again, it was subtle and not easy for me at least, but the fixes aren't hacks and I think make sense. Now we are working with the latest nextjs version, which provides important security updates and should make development a little faster and more robust. |
We are currently at next version 13.5.6, which works fine.This is the version right before the 14.x series.I tried to update to 14.0.3, which as of today just involved updating the next page in packages/next and packages/hub, and no other package updates.
It fails to render anything in dev mode with
I spent hours trying to debug this and got nowhere.
Obviously the problem is some antd compatibility issue.
I tried moving _document.tsx
but that made no difference.
If you try
which just directly runs next without the hub or that complexity, the problem is the same.
There are finally official directions to "try to use nextjs with antd" here -- https://ant.design/docs/react/use-with-next -- I had to figure out what we do in pages/_document.tsx before that. I tried those directions and it seemed to make no difference.
Maybe the problem has something to do with changes to the complicated babel configuration of nextjs. https://nextjs.org/docs/pages/building-your-application/configuring/babel
I tried to switch to using babble instead of SWC by creating this:
but try as I may, I got a lot of typescript errors, because clearly the typescript isn't being parsed.
Disabling "swcMinify: true, // enable faster RUST-based minifier" doesn't help in
next.config.js
.My guess is that people using and developing nextjs 14 have moved on to ESM modules, and that's that core reason for this problem appearing. We are still using commonjs to interface between our different modules, e.g., the hub imports the nextjs app. That's probably why this doesn't work. Obviously it would be nice to switch to ESM modules everywhere in cocalc, but that's likely a miserable herculean task.
The text was updated successfully, but these errors were encountered: