You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hoping someone can help as have been struggling to work around this.
I have a NextJS app that has a Custom Server (a typescript file server/index.ts transpiled to dist/index.js). The NextJS UI and server layer compile successfully and can be run without issue.
I have created a simplified copy of the repo here that demonstrates the issue. https://github.com/seanjb/nextjs-custom-server-ncc-issue
Npm scripts build and start work without issue. The package script (the NCC step) throws the error.
The Error thrown is:
Error: Module not found: Error: Package path ./server.edge is not exported from package C:\dev\test-ncc\node_modules\react-dom (see exports field in C:\dev\test-ncc\node_modules\react-dom\package.json)
Did you mean './react-dom/static.edge'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
I believe this server.edge component is specific to NextJS but not part of the official react-dom package (even though it appears in their main branch).
The text was updated successfully, but these errors were encountered:
Hey @imvad we ended up using rollup to package the custom server.
We use next build and standalone to package the UI, then a server build step packages the server using rollup.
Hoping someone can help as have been struggling to work around this.
I have a NextJS app that has a Custom Server (a typescript file server/index.ts transpiled to dist/index.js). The NextJS UI and server layer compile successfully and can be run without issue.
I have created a simplified copy of the repo here that demonstrates the issue. https://github.com/seanjb/nextjs-custom-server-ncc-issue
Npm scripts build and start work without issue. The package script (the NCC step) throws the error.
The Error thrown is:
I believe this server.edge component is specific to NextJS but not part of the official react-dom package (even though it appears in their main branch).
The text was updated successfully, but these errors were encountered: