Closed joulev closed 2 years ago
Hi can you try again with next@13.0.3-canary.3
? We patched a fix into it π
@huozhi Hi, unfortunately it doesn't work for v13.0.3-canary.3 yet :( in the repro repo above I have upgraded to canary.3 as well and it didn't work.
Gotcha seems related to another issue, reopened
It has been fixed now, thanks! π
@schickling Can you try next@13.0.3
to see if it works for you with the issue you mentioned in https://github.com/vercel/next.js/issues/41865#issuecomment-1310362880? I tried your reproduction it seems resolved the issue for me
Works π
I had a similar issue with mjml-react@2.0.8
& mjml@4.13.0
. It would not fin react-dom/server.js
on the server side (API route).
Upgrading to next@13.0.3 resolved the issue for me.
frontend_1 | error - Error: Cannot find module './server.node'
frontend_1 | Require stack:
frontend_1 | - /usr/src/app/node_modules/next/dist/compiled/react-dom/server.js
frontend_1 | - /usr/src/app/node_modules/mjml-react/dist/src/index.js
frontend_1 | - /usr/src/app/.next/server/pages/api/apply/final.js
frontend_1 | - /usr/src/app/node_modules/next/dist/server/next-server.js
frontend_1 | - /usr/src/app/node_modules/next/dist/server/dev/next-dev-server.js
frontend_1 | - /usr/src/app/node_modules/next/dist/server/next.js
frontend_1 | - /usr/src/app/node_modules/next/dist/server/lib/start-server.js
frontend_1 | - /usr/src/app/node_modules/next/dist/cli/next-dev.js
frontend_1 | - /usr/src/app/node_modules/next/dist/lib/commands.js
frontend_1 | - /usr/src/app/node_modules/next/dist/bin/next
frontend_1 | at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
frontend_1 | at Function.mod._resolveFilename (/usr/src/app/node_modules/next/dist/build/webpack/require-hook.js:23:32)
frontend_1 | at Function.Module._load (node:internal/modules/cjs/loader:833:27)
frontend_1 | at Module.require (node:internal/modules/cjs/loader:1057:19)
frontend_1 | at require (node:internal/modules/cjs/helpers:103:18)
frontend_1 | at Object.<anonymous> (/usr/src/app/node_modules/next/dist/compiled/react-dom/server.js:3:18)
frontend_1 | at Module._compile (node:internal/modules/cjs/loader:1155:14)
frontend_1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
frontend_1 | at Module.load (node:internal/modules/cjs/loader:1033:32)
frontend_1 | at Function.Module._load (node:internal/modules/cjs/loader:868:12)
frontend_1 | at Module.require (node:internal/modules/cjs/loader:1057:19)
frontend_1 | at require (node:internal/modules/cjs/helpers:103:18)
frontend_1 | at Object.<anonymous> (/usr/src/app/node_modules/mjml-react/dist/src/index.js:8:38)
frontend_1 | at Module._compile (node:internal/modules/cjs/loader:1155:14)
frontend_1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
frontend_1 | at Module.load (node:internal/modules/cjs/loader:1033:32)
frontend_1 | at Function.Module._load (node:internal/modules/cjs/loader:868:12)
frontend_1 | at Module.require (node:internal/modules/cjs/loader:1057:19)
frontend_1 | at require (node:internal/modules/cjs/helpers:103:18)
frontend_1 | at Object.mjml-react (/usr/src/app/.next/server/pages/api/apply/final.js:42:18)
frontend_1 | at __webpack_require__ (/usr/src/app/.next/server/webpack-api-runtime.js:33:42)
frontend_1 | at eval (webpack-internal:///(api)/./pages/api/apply/final/index.ts:6:68)
frontend_1 | at Object.(api)/./pages/api/apply/final/index.ts (/usr/src/app/.next/server/pages/api/apply/final.js:142:1)
frontend_1 | at __webpack_require__ (/usr/src/app/.next/server/webpack-api-runtime.js:33:42)
frontend_1 | at __webpack_exec__ (/usr/src/app/.next/server/pages/api/apply/final.js:152:39)
frontend_1 | at /usr/src/app/.next/server/pages/api/apply/final.js:153:28
frontend_1 | at Object.<anonymous> (/usr/src/app/.next/server/pages/api/apply/final.js:156:3)
frontend_1 | at Module._compile (node:internal/modules/cjs/loader:1155:14)
frontend_1 | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
frontend_1 | at Module.load (node:internal/modules/cjs/loader:1033:32)
frontend_1 | at Function.Module._load (node:internal/modules/cjs/loader:868:12)
frontend_1 | at Module.require (node:internal/modules/cjs/loader:1057:19)
frontend_1 | at require (node:internal/modules/cjs/helpers:103:18)
frontend_1 | at DevServer.runApi (/usr/src/app/node_modules/next/dist/server/next-server.js:467:34)
frontend_1 | at DevServer.handleApiRequest (/usr/src/app/node_modules/next/dist/server/next-server.js:812:21)
frontend_1 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
frontend_1 | at async Object.fn (/usr/src/app/node_modules/next/dist/server/next-server.js:736:37)
frontend_1 | at async Router.execute (/usr/src/app/node_modules/next/dist/server/router.js:252:36)
frontend_1 | at async DevServer.run (/usr/src/app/node_modules/next/dist/server/base-server.js:381:29)
frontend_1 | at async DevServer.run (/usr/src/app/node_modules/next/dist/server/dev/next-dev-server.js:724:20)
frontend_1 | at async DevServer.handleRequest (/usr/src/app/node_modules/next/dist/server/base-server.js:319:20) {
frontend_1 | code: 'MODULE_NOT_FOUND',
frontend_1 | requireStack: [
frontend_1 | '/usr/src/app/node_modules/next/dist/compiled/react-dom/server.js',
frontend_1 | '/usr/src/app/node_modules/mjml-react/dist/src/index.js',
frontend_1 | '/usr/src/app/.next/server/pages/api/apply/final.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/server/next-server.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/server/dev/next-dev-server.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/server/next.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/server/lib/start-server.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/cli/next-dev.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/lib/commands.js',
frontend_1 | '/usr/src/app/node_modules/next/dist/bin/next'
frontend_1 | ]
frontend_1 | }
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
In some ES module packages, the
exports
field inpackage.json
only includes oneimport
field. This causes some resolution errors when imported to server components. However,getStaticProps
and other data-fetching functions inpages
directory still works fine.Since it's quite vague to me, I think I will continue with the example. Clone the repo linked below.
The path
/test
(inpages
directory, withgetStaticProps
) works as intended. Meanwhile,/
(RSC inapp
directory) doesn't, with a confusing error message:That is (apparently) because
periscopic
'sexports
field is like thisAfter modifying this
exports
manually, inperiscopic
and 2 other similar modules (is-reference
andestree-walker
),then
/
works as intended.Ref: https://github.com/orgs/mdx-js/discussions/2168
Expected Behavior
/
should not crash and gives the same output as/test
in the linked reproduction repository.Link to reproduction
https://github.com/joulev/debug/tree/nextjs-42534
To Reproduce
Mentioned in the "Describe the Bug" section.
npm install
npm run dev
/
: crash/test
: works normally