Next.js Discord

Discord Forum

Module not found: Can't resolve '@vercel/turbopack-ecmascript-runtime

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
In the last 10 minutes, I've started to get a new error. You can see the main objection above. The error seems to be occurring in an pages/api enpoint with 'use server' as the first line. Full error:

https://i.gyazo.com/768e1252f7ff97210b8f21c7123ffbf0.png

any idea what to do here? As the error suggests, this blocks render for all my site.
Answered by Northeast Congo Lion
So I then just rewrote that particular file, and now it's working, so if anyone comes across this in the future, that's the news I have for you
View full answer

17 Replies

An api endpoint can’t be use server I think? You should backtrack your changes to figure out what specific thing broke it
It’s like trying to expose an api endpoint behind an api end point essentially and it doesn’t sound like a good thing lol
And a “page” also can’t be use server. You should read up on how the use server directives is suppose to be used.
@Northeast Congo Lion any luck?
Northeast Congo LionOP
Sorry, missed this... I ended up backtracking it and rewriting the code. The 'use server' endpoint was the one with the problem, as you predicted. I wasn't able to replicate the error after rewriting the code.
so I guess we can mark this as CND haha
But yeah, very strange error. Still not sure what caused it.
You can’t mark a route handler with the use server directive directly.
Whatever floats your boat just wanted to make sure you were set so I could unfollow the post. Please mark as resolved when you can if it’s resolved.
Northeast Congo LionOP
Yeah, so the thing that spawned that was... hang on, let me look through my logs for the error
Module not found: Can't resolve 'react-server-dom-webpack/client'
the render window actually said something different, it said it was missing module 'net'
Module not found: Can't resolve 'net'
The answer created all kinds of problems, but I guess technically fixed the "Net" thing, replacing it with the hmr problem
Anyway, so yeah, did a git reset to the last working branch, then manually started undoing the reset until it started breaking again, which pointed me to the file with 'use server'
Northeast Congo LionOP
So I then just rewrote that particular file, and now it's working, so if anyone comes across this in the future, that's the news I have for you
Answer