Skip to content
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

Serverless function module loading broken in v32.3.0 #10564

Closed
flynow10 opened this issue Sep 21, 2023 · 14 comments
Closed

Serverless function module loading broken in v32.3.0 #10564

flynow10 opened this issue Sep 21, 2023 · 14 comments

Comments

@flynow10
Copy link

flynow10 commented Sep 21, 2023

node: 18.x
vercel cli: 32.3.0
compiler: typescript

When I created a new deployment today, all of my Serverless functions were crashing while trying to import various node modules. I found that even after redeploying a working deployment, the Serverless functions would still crash.

I believe the problem lies in this pull request #10553, but I don't know the internals of Vercel well enough to diagnose this further.

If anyone else is having this problem, I have found work around by including the env var "VERCEL_CLI_VERSION"="vercel@32.2.5". Be aware that you will need to remove this variable to resume receiving updates from Vercel once this is fixed.

@DeckBlank
Copy link

I have the same problem , the before deploys with 32.2.5 , does not have this problem

@Battjmo
Copy link

Battjmo commented Sep 21, 2023

Yep, can confirm. I sure wish I could have the last hour and a half back trying to figure out how I broke everything 😅

Homepage was throwing a 500 with this in the logs:

2023-09-21T23:12:49.729Z undefined INFO - info Loaded env from /var/task/.env
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/node_modules/next/dist/server/require-hook.js:185:36
at Module._load (node:internal/modules/cjs/loader:922:27)
at e.._module.Module._load (/var/task/___vc/__launcher.js:15:1964)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED',
page: '/'
}
RequestId: 473a486f-5885-43bc-acc2-0f5c2669a2b0 Error: Runtime exited without providing a reason
Runtime.ExitError

@hypnocill
Copy link

@flynow10 wow, thank you so much for the prompt share of this! Tonight, I planned to sit on the computer for a 15 minutes and fix a few typos on my site. Only to have it break after the deploy and 3 hours later finally having it running again thanks to this thread!

@Marfuen
Copy link

Marfuen commented Sep 22, 2023

Wow thanks so much for the fix also have been dealing with this for a while

@delantai
Copy link

This was a great fix for us too, thanks. Was a shock for a little while 💀

@fuerst-one
Copy link

Thanks. Great work for finding the issue and providing a quick workaround.

@estevamcardoso
Copy link

Spent 2 hours removing piece by piece what I did today... and even with a full revert, crashed. Only one option. The building tool is crashing it or something.

Thanks @flynow10 for the help!!

@optimista
Copy link

optimista commented Sep 22, 2023

I confirm the error. 500: Internal server error. Happens only on direct refresh (typing URL directly into the address bar - SSR), not on client reload (when clicking on a link within the application - CSR) and only in production. I did try to isolate it by creating completely minimal app/layout.js and completely minimal page - error was still showing. To me it happens only on pages with dynamic routes.

@yamen
Copy link

yamen commented Sep 22, 2023

I can confirm everything @optimista has said - only happening on directly browsed pages, and doesn't happen locally.

@VladSez
Copy link

VladSez commented Sep 22, 2023

cc @leerob could you, please, take a look?

@PaulWild
Copy link

My team are experiencing the same issue with 32.3.0. Pinning to to 32.2.5 has worked as a temporary solution

@dan-stowell
Copy link
Contributor

dan-stowell commented Sep 22, 2023

Thank you for sharing this problem and the workaround, @flynow10!

The issue has been fixed in v32.3.1.

Any deployments using Next.js v13.4.3-v13.5.1 made between 2023-09-21 20:33 UTC and 2023-09-22 09:53 UTC could have seen elevated serverless function errors. Redeploying affected projects should solve the problem!

We strive for changes to vc build to never cause runtime errors. vercel/vercel has a suite of end-to-end tests to catch any regressions. Vercel also gradually rolls out vc build changes across the build infrastructure to limit the damage of any bugs that our tests do not catch. In this, we had a test gap and a monitoring gap. We'll follow up on this issue with root causes for those gaps.

@ktcarter
Copy link
Contributor

ktcarter commented Sep 22, 2023

There was an incident with the latest Vercel CLI release that affected some customer deployments.

Please follow our status page for the latest updates:
https://www.vercel-status.com/incidents/dg7l3pz92c19

@flynow10
Copy link
Author

Thank you for getting this resolved quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests