Fix Studio Code syntax error in Node.js 22 - #3885
Conversation
|
A quick look at the Vite docs suggests that |
📊 Performance Test ResultsComparing 1d79dd8 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
sejas
left a comment
There was a problem hiding this comment.
Looks good. Thanks for fixing it. I confirm I was able to execute nvm use 22 && node apps/cli/dist/cli/main.mjs code after running nvm use && npm i && npm run cli:build.
We could consider using node 22 CI unit test or similar.
@youknowriad also suggested some smoke tests (in the true "does this thing even work?" sense) that we could run for different Node.js versions. I'll defer to @bcotrim on this, because I think he might be driving changing the E2E test suite to run on the CLI at some point soon |
Related issues
How AI was used in this PR
Claude was used to help identify and fix the issue.
Proposed Changes
We recently updated to Vite 8 (see #3674 and related PRs). Previously, Vite transformed the JS output to support our targeted Node.js version. It still can, but Vite 8 wasn't picking up the transform target based on our existing config. This PR adds the necessary config to transform the output JS code so Node.js 22 supports it.
All of this is obviously related to Vite 8 swapping out esbuild/Rollup for Rolldown.
Testing Instructions
npm run cli:buildnvm use 22node apps/cli/dist/cli/main.mjs codePre-merge Checklist