Closed badfun closed 3 years ago
I've gone back to an older project and it runs fine:
"next": "9.3.5",
"react": "16.13.1",
"react-dom": "16.13.1"
Confirmed: changing to 9.3.5 works, even leaving latest versions of react intact:
"next": "^9.3.5",
"react": "17.0.1",
"react-dom": "17.0.1"
Judging by this issue, it seems to be a problem some of us are facing with later versions: https://github.com/vercel/next.js/issues/16535#issuecomment-679950934
Can't reproduce this based on the provided steps. Please provide a repository where it consistently reproduces so that we can have a look, thanks!
Also created a branch using 9.3.5.
https://github.com/badfun/nextjs-clean-test/tree/using-next9.3.5
Still can't reproduce when using the repository 🤔
Yeah, that's not surprising. It's a clean install, so the repo is just a 'npx create-next-app' and then uploaded. No changes made on my part whatsoever.
Whatever the conflict is, I've just confirmed that this strange workaround gets past it: https://github.com/vercel/next.js/issues/16535#issuecomment-738857277
For now I'll just employ that strategy. thanks.
Can you check if you have some dependency directory (e.g. node_modules or globally installed through npm) version of next.js, react / react-dom, or other deps?
No I don't. I recently cleaned up all my global packages so only have these:
+-- @aws-amplify/cli@4.38.0 +-- aws-cdk@1.71.0 +-- lumigo-cli@0.47.0 -- typescript@4.0.5
I spent some time on it this morning, and I can confirm that the error still persists using Git bash and the terminal in VSCode. Both use Git for Windows. However, I went through the install process using Console Window Host (Windows\System32\conhost.exe) and it works fine. So my best guess is there is some conflict with Git for Windows, which the VSCode hack mentioned here https://github.com/vercel/next.js/issues/16535#issuecomment-738857277 seems to solve. I suspect it has to do with path naming in Windows.
Anyway, I think enough time has been spent digging into this. Thanks for your help Tim. At least there is a work-around, and I'm pretty certain it's not a bug with nextjs after all. Thanks!
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Bug report
Describe the bug
npm run dev ("next dev") after a clean install (npx create-next-app) fails to launch the server. First, it announces "ready on http://localhost:3000", then after a second it throws a pile of warnings ("There are multiple modules with names that only differ in casing") but ends with the "ready on http://localhost:3000" message again. When trying to access the url, it throws the warnings again, then crashes with an "Invalid hook call" error.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
I expect to see the server running on localhost 3000, as per step 2 of the installation procedure.
Screenshots
System information
Additional context
Add any other context about the problem here. fails using gitbash, or terminal in VSCode