-
Notifications
You must be signed in to change notification settings - Fork 509
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
feat(vercel): auto-detect runtime version #879
Conversation
436eeb1
to
5c6c601
Compare
@smaeda-ks any news on this PR? We really need this in a prod env. |
@smaeda-ks Can we split auto detection part to merge new configuration sooner? 🙏🏼 |
This PR adds a few new environment variables for project settings. This allows frameworks targeting the [Build Output API](https://vercel.com/docs/build-output-api/v3) to read data that is normally only available in through the `config` object when developing a [Builder/Runtime](https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md). This will also solve the problem of old Builders/Runtimes that never passed the `config` through to `getNodeVersion()`. - Related to nitrojs/nitro#879
49d2c3c
to
5df76ca
Compare
5df76ca
to
9eb9e29
Compare
Hi! Is there any updates on this? Today we are going to release Nitropack 2.1 / Nuxt 3.2 |
Do we have example code that reproduces this issue? How can we confirm this PR fixes the issue? |
34722b9
to
8e90828
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust process.versions.node.split('.')[0]
is expected behavior from vercel.. @styfle do you confirm too?
Codecov Report
@@ Coverage Diff @@
## main #879 +/- ##
==========================================
+ Coverage 67.79% 67.81% +0.01%
==========================================
Files 59 59
Lines 6003 6005 +2
Branches 679 679
==========================================
+ Hits 4070 4072 +2
Misses 1924 1924
Partials 9 9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Lets try it out with a real deployment and try setting engines
to see if that is respected.
Tested that the PR works as expected: smaeda-ks/nuxt3-vercel-nitropack-pr-879#1 preview: https://nuxt3-vercel-nitropack-pr-879-git-test-smaeda-ks.vercel.app/api/hello build logs: https://vercel.com/smaeda-ks/nuxt3-vercel-nitropack-pr-879/7DqeaQXiJ6YsdwurX4oqWuzTPvrf#L6 |
Awesome! It works! :) Thank you guys so much! |
Currently, it's setting
nodejs16.x
statically, so any serverless functions are deployed with Node.js v16.x regardless of the project's Node version setting:https://vercel.com/docs/concepts/functions/serverless-functions/runtimes/node-js#node.js-version
This PR changes the behavior and starts producing the
.vc-config.json
file (for Vercel Build Output API) with the running OS's Node runtime version. This prevents Node version mismatch between build time and runtime.🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist