#netlify returns "Internal Server Error" when page not found rather than nextjs 404 page

21 messages · Page 1 of 1 (latest)

random moat
#

as the title said, when i updated my site's paths, some where deleted and when i go to see the old ones, netlify returns an "Internal Server Error" from them rather than a 404 custm page from not-found which i built

floral mulchBOT
#

🔎 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)

random moat
#

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'
}
pliant ember
#

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

random moat
#

rather than 404 page from nextjs

#

would it be related to next 13.4.19 should i downgrade?

pliant ember
#

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

random moat
#

okay

pliant ember
#

good luck my man

pliant ember
#

did it work?

random moat
random moat
#

@pliant ember sorry for the late response but i got sick and now i did what you said.

still didn't work