#netlify returns "Internal Server Error" when page not found rather than nextjs 404 page
21 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
to add something that the invalid paths/ routes are available in google search console and they are not yet cleared, so traffic is coming from google for these pages and netlify is serving them a Internal Server Error rather my nextjs not-found page
netlify functions log:
Sep 1, 05:03:24 PM: 4ade9072 ERROR Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" in /var/task/node_modules/react-dom/package.json
at new NodeError (node:internal/errors:405:5)
at exportsNotFound (node:internal/modules/esm/resolve:364:10)
at packageExportsResolve (node:internal/modules/esm/resolve:700:9)
at resolveExports (node:internal/modules/cjs/loader:567:36)
at Module._findPath (node:internal/modules/cjs/loader:636:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
at /var/task/.netlify/functions-internal/___netlify-handler/requireHooks.js:100:40
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:110:18) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
npm update
npm audit fix --force
if ur npm update fails run it with the --force flag
if u still have this issue, delete ur node modules and .next file and package lock json and npm install
then restart ur ide
in local development and build everything works as expected but this error happens when i deploy to netlify, the site works fine but when i go to a route that isn’t available i get an internal server error
rather than 404 page from nextjs
would it be related to next 13.4.19 should i downgrade?
ik
but netlify isn't accepting a specific package
for some reason
that's why I'm asking u to try and run these commands in order to fix it
try all these on top if it doesn't work then sure downgrade
okay
good luck my man
did it work?
my laptop is not in my reach rn, but when i get home i will do that
alright
@pliant ember sorry for the late response but i got sick and now i did what you said.
still didn't work