-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server.edge' is not defined by "exports" #49169
Comments
same for me. |
Fixes #48948 ([repro](#48948 (comment))). When running inside a custom server with app dir, we should always opt into the prebundled React with correct channels. Thanks @karlhorky for help testing it! Fixes #49169 too. --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@shuding Was this suppose to be fixed in 13.3.5-canary.8? I'm still seeing the same error :/ |
I can confirm CodeSandbox: https://codesandbox.io/p/sandbox/quirky-bell-o5tl8l?file=%2Fserver.mjs |
@khuezy maybe you can try creating a reproduction of the error on CodeSandbox? (I think currently, StackBlitz doesn't work because of problems with the binary - at least it was broken yesterday) If you're still getting the error and you're not using a custom server, it is probably some other feature you're using...? |
@karlhorky will do. Do you have your codesandbox I can fork? It looks like it's been removed :( |
Sure, just made the sandbox linked above public - I keep forgetting that CodeSandbox is now private by default. |
still not working on 13.4.0 |
Ok I had some help w/ the issue, the problem was this: |
Same problem here in version 13.4.0 |
@khuezy changing the env works (after adding serverActions: true in next.config) im not sure about the consequences though |
This is an issue when deployed to netlify with 13.4.1. What's worse is netlify won't except then env variable because it starts with _ |
Same issue deploying to Azure static web app. Lastest working next npm version is 13.2.4 |
I'm having the same issue on latest version. It happens in both dev (windows) and in production (ubuntu). I'm not using any custom server. I'm using turborepo with yarn v3. But I don't use turborepo in dev and also I used yarn to build in production and still same issue |
We're seeing this issue today on our vercel deployment. We're not using a custom server and it isn't happening on our local. We're using next 13.4.1 with turborepo and pnpm on node 18.
|
@esauri I had a similar issue with next 13.4.1, turborepo, pnpm and node 18. In my case, client-side navigation to a dynamic (app router) page would work, but performing a full reload would give the same error. Triggering a Redeploy with the Use existing Build Cache option unchecked seemed to resolve it for me. Potentially an issue with the pnpm store cached by turborepo? I'm not sure - let me know if it works for you. |
Yes it was resolved a few hours later. I assume it was related to this issue yesterday https://www.vercel-status.com/incidents/mj596gzq35xw. |
Same issue during dev and build, I don't use turborepo but pnpm, so the common denominator seems to be pnpm @shuding I think this is not fully solved by the PR, I am using 13.4.0 |
I'm not using pnpm or Turbo and I'm receiving this error in my production environment using Next 13.4.0 and npm 8.19.3. |
@eric-burel @PassTheMayo and others, I think what's missing here is a reproduction of the bug as mentioned above. Want to try creating one? |
@karlhorky yeah agreed it's hard to debug without a repro, but I couldn't yet put my finger on what trigger this issue. My app is open source but not minimal. It feels like a problem in the react-dom package export map. The export map of "react-dom" is like so:
So no "server.edge" indeed. I am using 18.2.0. So the latest version of react-dom seems to be not enough. Edit: the issue seems to disappear with "react-dom" 18.3 canary release indeed (for lost googlers: this is obviously a bad idea ti use react-dom canary version in your app). I don't get why "server.edge" is loaded in the first place, that's probably the underlying issue. "__NEXT_PRIVATE_PREBUNDLED_REACT=next" is the temporary fix that works Here are some detailled logs if that can help someone:
|
More context, not sure if this helps: I think the previous problem was caused by the newer (experimental or canary) versions of Regarding the reproduction: maybe even a non-minimal repro would be helpful, if you can link it. |
It looks like in your stack trace that you have OpenTeletry enabled (maybe via Could this be a common denominator for some other people in the thread too? |
Here's the code: https://github.com/Devographics/Monorepo/tree/7a1114660a3a82d26b252fe34a795a475dbb99d0/surveyform I don't have |
Had the same error happen today, same Next version between deploys (13.4.19), just a minor update that added some POST functions to route handlers that only handled GET. Updating to 13.5.2 worked. |
Upgrade to 13.5.2 fix worked also for me. However, this caused a problem with Storybook. Discussion is here |
Upgrading to 13.5.1 and 13.5.2 gives me this error, not yet sure if it's in my code or some dependency
|
If this is happening in vercel, see the following issue. |
Upgrading to 13.5.2 worked for me as well. |
Curious to understand what caused this issue to appear on vercel today, so we can learn how to mitigate something similar in future. Could it be related to the recent update of react canary? |
Updating version to 13.5.2 worked for me |
Updating version to 13.5.2 worked for me. |
updating to |
@zetorama I would like to know what Vercel is going to do about QA of Vercel CLI upgrades vercel/vercel#10564 I'd prefer not to have to pin vercel CLI version but at the moment it looks wise to do so to avoid surprises like this affecting production without changes on our side. |
This issue
on next 13.5.2 was caused by react-bootstrap-icons - I could see that with
Adding |
upgrading to next |
UPD: another solution to this issue (besides updating to latest next version) is to set the env var |
I hope the team explains why this problem has occurred to so many since yesterday and today. Is it an internal problem in Vercel? Why updating to next 13.5.2 fixes it? |
Same here. Re-building old builds is not working. But there's a old deploy I can access on vercel and it's working. If I try to deploy this same commit it just don't work on the new deploy. Updating next to 13.5.2 didn't fix it. |
This did the trick to me. Thanks! |
There was an incident with the latest Vercel CLI release that affected some customer deployments. Please follow our status page for the latest updates: |
But what if we get this error when we are not using vercel, just running using node, and version 13.5.3 of Next. |
Upgrading to 13.5.2 and fixed it to me! |
This closed issue has been automatically locked because it had no new activity for 2 weeks. 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
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
sorry i can't upload because my project contains localhost database connections
To Reproduce
On my own server.js file, every page of my application in development mode gets the same error, while on my own server.js file in localhost in production mode, I get this error on the pages under [slug]! When I run this with my server.js file I get this error. While it then worked on 13.3.1, it's now broken!
What am I missing in my server.js file or what should I do? I got this error in the last 13.3.2-canary.7 and it continued in later versions! Normally, I get this error when I refresh the pages under news-media/[slug] and other pages under news-media/[slug] while opening in production mode. I get this error on every page in development mode!"dev": "next dev",
"build": "next build",
While "start": "next start" was OK, as I mentioned above on my server.js file, after the "next 13.3.1" version, errors started on server.js both in development and production mode!
Here's my run npm commands for my own server.js:
"httpsDevelopment": "node --max_old_space_size=8192 server/server.js",
"httpsProduction": "next build && node server/server.js production",
My server.js file looks like this:
Describe the Bug
What am I missing in my server.js file or what should I do? I got this error in the last 13.3.2-canary.7 and it continued in later versions! Normally, I get this error when I refresh the pages under news-media/[slug] and other pages under news-media/[slug] while opening in production mode. I get this error on every page in development mode!"dev": "next dev",
"build": "next build",
While "start": "next start" was OK, as I mentioned above on my server.js file, after the "next 13.3.1" version, errors started on server.js both in development and production mode!
While in development:
While in production:
Expected Behavior
I expect it to run smoothly on my own server.js file, both in development and production mode. I have 2 similar tickets closed. But the problem persists in a similar way!
Which browser are you using? (if relevant)
Chrome 112.0.5615.138
How are you deploying your application? (if relevant)
on my localhost with the command "next build && node server/server.js production". or "node --max_old_space_size=8192 server/server.js"
NEXT-1413
The text was updated successfully, but these errors were encountered: