Next.js Discord

Discord Forum

"Module not found" error

Unanswered
Ichneumonid wasp posted this in #help-forum
Open in Discord
Original message was deleted.

33 Replies

Avatar
Asian black bear
do you have a 'use client' directive on the page?
Avatar
Ichneumonid wasp
yes
is that the reason?
Image
Avatar
Asian black bear
no, you need it there
Avatar
Ichneumonid wasp
for sure thanks, i still dont know what could be giving this error though
Avatar
Asian black bear
yarn, npm, or pnpm?
Avatar
Ichneumonid wasp
npm
Avatar
Asian black bear
Actually everything looks right
I would delete node_modules and .next/
and hope it magically fixed the problem
Avatar
Ichneumonid wasp
so by deleting those 2 directories will help?
why is that?
Avatar
Asian black bear
I mean, it won't not help
Avatar
Ichneumonid wasp
yea thats what im saying
Avatar
Asian black bear
because the issue could be that either the next cache directory/dev server is in an invalid state (which has been a FREQUENT problem for me lately after all of their speedy caching improvments)
or it could be that the packages are somehow installed wrong/or have been tainted, such that running npm install again will fix them
actually, I have been particularly been having trouble with the dev server seeing an error like that, and then literally ignoring future changes to the files
Avatar
Ichneumonid wasp
i have done this already but to no avail
yes exactly and its super frustrating
Avatar
Asian black bear
restarting the dev server usually fixes it for me
but I have had to wipe the .next directory as well
At Vercel they dogmatically insist caching can fix all performance issues, and with the last few releases of next the changelogs have talked a lot about "speed improvments"
Avatar
Ichneumonid wasp
The issue was that when I committed, my main branch and master branch didn’t have the same code
So I had to merge both via terminal and it worked
Avatar
Asian black bear
Oh that is a weird one, package manager mismatches in branches is a nightmare
Avatar
Ichneumonid wasp
this is the project im working on
Avatar
Asian black bear
So smooth
Avatar
Ichneumonid wasp
seriously? the data is for trees
in nyc
Avatar
Asian black bear
printing stuff on a map in a way that doesn't suck seems to be really hard
I have used enough terrible map widgets to know