platforms icon indicating copy to clipboard operation
platforms copied to clipboard

sub.domain.com/slug 500 error

Open mworks-proj opened this issue 1 year ago • 0 comments

Getting this error for all posts (slug) in production env only. see log errors below

Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-mdx-remote/index.js from /var/task/.next/server/app/[domain]/[slug]/page.js not supported.
Instead change the require of index.js in /var/task/.next/server/app/[domain]/[slug]/page.js to a dynamic import() which is available in all CommonJS modules.
at /opt/rust/nodejs.js:1:11508
at Function.Qt (/opt/rust/nodejs.js:1:11878)
at Q.e.<computed>.K._load (/opt/rust/nodejs.js:1:11478)
at h.require (/var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:11:91121)
at 20349 (/var/task/.next/server/app/[domain]/[slug]/page.js:1:3413) {
code: 'ERR_REQUIRE_ESM',
digest: '2247482812'
}
⨯ Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-mdx-remote/index.js from /var/task/.next/server/app/[domain]/[slug]/page.js not supported.
Instead change the require of index.js in /var/task/.next/server/app/[domain]/[slug]/page.js to a dynamic import() which is available in all CommonJS modules.
at /opt/rust/nodejs.js:1:11508
at Function.Qt (/opt/rust/nodejs.js:1:11878)
at Q.e.<computed>.K._load (/opt/rust/nodejs.js:1:11478)
at h.require (/var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:11:91121)
at 20349 (/var/task/.next/server/app/[domain]/[slug]/page.js:1:3413) {
code: 'ERR_REQUIRE_ESM',
digest: '2247482812',
page: '/subdomain.domain.site/slug'
}
Error [ERR_REQUIRE_ESM]: require() of ES Module /var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next-mdx-remote/index.js from /var/task/.next/server/app/[domain]/[slug]/page.js not supported.
Instead change the require of index.js in /var/task/.next/server/app/[domain]/[slug]/page.js to a dynamic import() which is available in all CommonJS modules.
at /opt/rust/nodejs.js:1:11508
at Function.Qt (/opt/rust/nodejs.js:1:11878)
at Q.e.<computed>.K._load (/opt/rust/nodejs.js:1:11478)
at h.require (/var/task/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:11:91121)
at 20349 (/var/task/.next/server/app/[domain]/[slug]/page.js:1:3413) {
code: 'ERR_REQUIRE_ESM',
digest: '2247482812',
page: '/subdomain.domain.site/slug'
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.

Please advise anyone that has resoled this issue.

mworks-proj avatar May 17 '24 21:05 mworks-proj