It’s a bit of a mystery. A real pain.
I tried remixing your project and throwing a few things at it…
- Running
next
instead ofnode server.js
… same error - Running
enable-npm
to force npm instead of pnpm… same error - Removing and reinstalling node-modules… same
- Upgrading all versions of react, react-dom, and next to latest… same
- Running
enable-pnpm
in case it cleaned up some erroneous packages as in this case… same error.
The only thing I think is suspicious is that Glitch node packages are at e.g.
/rbd/pnpm-volume/d5772895-b0ac-48a6-88a9-7e3d4afce4a4/node_modules/next/dist/next-server/server/render.js:50:72
And two of the commenters on the GH issue said “I had a node_modules folder in a parent directory up the tree that was causing issues. I deleted that and it started working as expected,”
…which was why I tried disabling pnpm. But it still seems to keep the modules in that dir.
Wish I could help more…