fix(sandbox): Fix broken scripts on sandbox build - #1824
Conversation
|
@spuppo-mux is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
As per Slack, let's normalize to |
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: 22 | ||
| node-version-file: '.nvmrc' |
There was a problem hiding this comment.
@mihar-22 double checking with you if these were hardcoded to 22 on purpose or if these changes are ok
|
note: only places I didn't update node was question: Related to the previous note, should I also update @types/node version in devDependencies to ^22 | ^24? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
When running
pnpm run buildthe following was failingOn Sandbox:
Unknown file extension ".ts"vite.config.tswas doing a runtimeawait import(pathToFileURL('scripts/shared.ts')), which bypassed esbuild and was used Node's native loader. Switched to a staticimport { mirrorTemplatesToSrc } from './scripts/shared'(bundled/transpiled with the config).On Site:
DurationFormat is not a constructorIntl.DurationFormatexists in Node 24 but not Node 22:getDurationFormatternow falls back whenIntl.DurationFormatis absent. Gated the two Intl-delegation tests withit.runIfand added a fallback-path test.site/src/content/docs/concepts/browser-support.mdx:25:This PR also includes a node version upgrade in
.node-versionand.npmrc, as well as switching the node-version to use node-version-file in two github workflows (as done in the rest of the workflows)Open question (resolved):
Node version mismatch:
- 22.19.0:
.node-version(read by fnm/asdf/nodenv/volta),.npmrc,.node-version, andpackage.jsonengines >=22.19.0.- 24.14.0:
.nvmrc(nvm only), plus most CI jobs vianode-version-file.Resolved: We resolved to upgrade node version to 24.14.0.
Note
Medium Risk
Time-display fallback changes user-visible strings on older runtimes; Node 24 bump affects all contributors and CI. Sandbox build path change is localized but on the critical build pipeline.
Overview
Fixes
pnpm run buildfailures from sandbox Vite config loading and site builds on Node withoutIntl.DurationFormat, and aligns local/CI Node to 24.14.0.Sandbox:
vite.config.tsno longer runtime-importsscripts/shared.tsviapathToFileURL(which triggered Node’s native.tsloader). It now statically importsmirrorTemplatesToSrcfrom./scripts/sharedso the config is bundled/transpiled with the rest of the Vite setup.Time formatting:
getDurationFormatterinpackages/utils/src/time/format.tstreatsIntl.DurationFormatas optional. When it’s missing (e.g. Node < 23 during SSR/prerender), it usescreateFallbackFormatter: exact digitalH:MM:SSoutput and English comma-separated phrases for localized styles. Tests gate Intl-specific cases withit.runIf/it.skipIfand addloadWithFallback()coverage for the fallback path.Node version:
.node-versionand.npmrcmove from 22.19.0 to 24.14.0 (matching.nvmrc).bundle-size.ymlandwebsite-tests.ymlswitchsetup-nodefrom hardcodednode-version: 22tonode-version-file: '.nvmrc'.Reviewed by Cursor Bugbot for commit 97ee7df. Bugbot is set up for automated code reviews on this repo. Configure here.