There are multiple modules with names that only differ in casing.
Answered
ncls. posted this in #help-forum
ncls.OP
I'm getting this error after I moved my project into a sub folder:
Even if I move it back or create a new Next.js project inside that folder, the error appears.
Any ideas why this is happening?
./node_modules/next/dist/shared/lib/head.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:Even if I move it back or create a new Next.js project inside that folder, the error appears.
Any ideas why this is happening?
Answered by ncls.
Seems like my terminal was the issue?! Restarting it just helped. I don't know... Thanks for the help though
18 Replies
ncls.OP
I completly reinstalled
node_modules like 5 times already but I still keep getting a ton of these errors. The paths it shows me in the error message as sources are a ton of /node_modules/next/dist/... but how am I supposed to fix those if reinstalling doesn't help???Can you provide a screenshot of your file structure?
It also happens with fresh projects I create (at least in the parent folder, haven't tried in another one. Will check now)
Works in other folders.
Did it like this
Did it like this
nextjs-projects
â”” My issue project
â”” client // doesn't work
â”” server
â”” My test project // worksHave you tried deleting .next folder?
ncls.OP
I didn't do that. Does it recreate itself again when I run
npm run dev?Yep
It’s basically cache files
ncls.OP
Oh, right
I just delted both
node_modules and .next but I get the same errors againStrange, try renaming “client†folder to something else?
ncls.OP
Nope, no luck.
Here's a full error btw:
It's basically this getting spammed into my console for various modules from Next.js
Here's a full error btw:
./node_modules/next/dist/shared/lib/router/utils/is-bot.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* javascript/auto|C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[7].oneOf[4].use[2]!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\shared\lib\router\utils\is-bot.js|app-pages-browser
Used by 1 module(s), i. e.
javascript/auto|C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[7].oneOf[4].use[2]!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\client\components\app-router.js|app-pages-browser
* javascript/auto|C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[7].oneOf[4].use[2]!C:\Users\Niclas\desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\shared\lib\router\utils\is-bot.js|app-pages-browser
Used by 1 module(s), i. e.
javascript/auto|C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Niclas\Desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[7].oneOf[4].use[2]!C:\Users\Niclas\desktop\nextjs\reved-ddf\something-else\node_modules\next\dist\client\components\app-router.js|app-pages-browser
Import trace for requested module:
./node_modules/next/dist/shared/lib/router/utils/is-bot.js
./node_modules/next/dist/client/components/app-router.jsIt's basically this getting spammed into my console for various modules from Next.js
ncls.OP
I also just created a whole new project so like that:
nextjs-projects
â”” My issue project
â”” client // doesn't work
â”” server
â”” My test project // works
â”” New project
â”” client // doesn't workI don't know why it is but it is only when I use those subfolders
I don't get why it cares about where the project is located
Ok, now also other projects don't work anymore WTF
ncls.OP
Seems like my terminal was the issue?! Restarting it just helped. I don't know... Thanks for the help though
Answer