500 error on the SSG page in Next.js 13.4

The site has been published and all errors from deploy stage have been fixed. But when I try to visit a route with SSG I get 500 internal server error. Currently i can’t understand what causes this error: environment variables(maybe because on I use .env.local instead of just .env on localhost; I added all env variables), mockAPI where I fetch information(but support has told that I can fetch data not only from localhost) or something else. I deployed the site using netlify interface. The route with the error: My projects

Hi there @Rutakata and sorry to hear about the trouble!

I think you have /projects redirected to your builder function/ISR handler. When I look in your ISR handling logs (here, in our UI: Netlify App), I see the problem, although I don’t know the fix:

Oct 2, 01:08:49 PM: 25656c6d 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
Oct 2, 01:08:49 PM: 25656c6d ERROR      at new NodeError (node:internal/errors:405:5)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at exportsNotFound (node:internal/modules/esm/resolve:364:10)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at packageExportsResolve (node:internal/modules/esm/resolve:700:9)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at resolveExports (node:internal/modules/cjs/loader:567:36)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at Module._findPath (node:internal/modules/cjs/loader:636:31)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at /var/task/.netlify/functions-internal/___netlify-odb-handler/requireHooks.js:100:40
Oct 2, 01:08:49 PM: 25656c6d ERROR      at Module._load (node:internal/modules/cjs/loader:922:27)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at Module.require (node:internal/modules/cjs/loader:1143:19)
Oct 2, 01:08:49 PM: 25656c6d ERROR      at require (node:internal/modules/cjs/helpers:121:18) {
Oct 2, 01:08:49 PM: 25656c6d ERROR    code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'Oct 2, 01:08:49 PM: 25656c6d ERROR  }

Hopefully that can help you find a fix now that you know the proximate cause of the error!

1 Like

Thank you. This log helped me to fix the error. Now everything works fine

1 Like