developertools.tech icon indicating copy to clipboard operation
developertools.tech copied to clipboard

Update packages

Open wesleyhitson opened this issue 1 year ago • 6 comments

Contact Details

[email protected]

Explain the proposed feature

Update packages. The main update is a major Next version. This will eliminate several vulnerabilities.

Explain the possible use cases for the feature

Fewer vulnerabilities.

Any other details you would like to provide?

No response

wesleyhitson avatar Oct 23 '23 00:10 wesleyhitson

@dlford created this issue to update packages.

wesleyhitson avatar Oct 23 '23 00:10 wesleyhitson

Getting an error after updating to Next.js 13, apparently I'm not the only one: Error: Hydration failed because the initial UI does not match what was rendered on the server. https://stackoverflow.com/questions/71706064/react-18-hydration-failed-because-the-initial-ui-does-not-match-what-was-render Check out the answer from hansaplast (or Ctrl+f "Next.js 13").

I disabled my browser extensions to make sure it wasn't related to anything they were doing. The site text is also randomly getting translated to different languages, and the language dropdown is on the left side of the page, so I think updating may have broken several things. I am going to try to solve all the issues:

  • spontaneous translation
  • language menu placement
  • Hydration failed

wesleyhitson avatar Oct 23 '23 02:10 wesleyhitson

@wesleyhitson you might find some good information here on the upgrade - https://nextjs.org/docs/pages/building-your-application/upgrading/version-13

dlford avatar Oct 24 '23 05:10 dlford

@dlford I looked through that and that helped, thank you. I was able to fix the hydration error, and the language menu seems to be in the correct location.

Maybe you can help me understand more about the i18n setup. When running in localhost, when I click on a different page, in the right menu, the new page loads, but in the first language available for translation. When I refresh the page, it loads with the correct language. The translated pages seem to still be under the "normal" URLs (as opposed to /[country code]/[page name]). The right menu also has a mix of languages in it.

Additionally, I can select different languages from the dropdown, but the language translated to appears to be random. It almost seems like i18n is conflicted with itself somehow.

wesleyhitson avatar Oct 27 '23 02:10 wesleyhitson

@wesleyhitson that is strange, is your locale translated or missing? The default locale is en-US, so if your locale is not translated it should show it in en-US as a fallback.

dlford avatar Oct 28 '23 00:10 dlford

I checked that and that was indeed my locale, so I'm not sure. Could be a weird bug with the Nextjs 13 upgrade. Funny enough I saw Nextjs 14 was just released. 13's big thing seems to be getting everyone to switch the application structure to use an app/ folder, and I'm not so sure I want to restructure the whole project just for that haha. Let me see if I'm still getting the translation behavior if I don't do any updates at all. I'll get back to you @dlford

wesleyhitson avatar Oct 28 '23 04:10 wesleyhitson