Really obscure TypeError when starting Next.js
I have zero clue what's causing this but i just cloned my project on my mac after having developed it on windows for some time and i literally can't start the dev server due to this error, none of my pages load, and if i do not resolve this I will not meet the project deadline.
here's a hastebin because discord bad https://hasteb.in/F3PcqE4BWtMopGQ
7 Replies
Researched this error a little
Turns out it's either due to
node_modules
or the use of pnpm
Try deleting node_modules
and running pnpm i
Solution
If that fails, try using
npm
, yarn
, etc.Further reading if you're on the NextJS server: https://discord.com/channels/752553802359505017/1093478982340587540
cool, thanks. not in the next server but i guess i’ll just use yarn since i already tried purging node_modules.
Bumping this since i just got back to work on this project after a few weeks of inactivity. For anyone reading after the fact this issue is not with pnpm. I also experienced it just now with npm.
I've removed the
packageManager
field from package.json and purged my node_modules. I'm now reinstalling with yarn and yet again i have the same error.
how do i unmark the solution because that clearly wasn't it.
for the record i have had zero issues with this on windows but on my mac it just doesn't fucking work
oh wait
yeah no it finally worked. remove node_modules, get rid of the stupid corepack field and yarn && yarn dev
and it's good
pnpm, wtf?lol, don't know why it happened, but glad it got resolved
oh well. shit happens i guess, it’s webdev