chore(deps): update nuxt to 4.5.1 and vite to 8 - #649
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
==========================================
- Coverage 28.33% 27.92% -0.42%
==========================================
Files 391 391
Lines 12276 12457 +181
Branches 1977 1945 -32
==========================================
Hits 3478 3478
- Misses 8699 8880 +181
Partials 99 99
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`use-payment.ts` named a ContractRef parameter and a local `ref`, which
shadows the auto-imported `ref` from vue. Two other files did the same with
a referral code, and `actions.ts` with two more ContractRef parameters.
This was latent under vite 7 but breaks under vite 8. Rolldown sees the
inner `ref` bindings, renames the imported one to `ref$1` to avoid the
collision, and then fails to rewrite two call sites in the enclosing scope:
import { ref as ref$1, computed, shallowRef, ... } from "vue"
...
const sponsorshipState = ref({ status: "idle" }); // never defined
At render time that is a ReferenceError, so /sponsor/mint returned a 500 and
`nuxi generate` aborted on it.
Renaming ours to `contractRef` and `referral` removes the collision, and is
what the code should have said in the first place. Swept the whole workspace
for locals shadowing vue auto-imports; these five were the only ones.
@nuxt/test-utils rewrites this tracked file on install. The 4.0.3 -> 4.1.0 bump landed in the patch sweep but the regenerated file was not committed with it.
- nuxt 4.4.7 -> 4.5.1 - vite 7.3.5 -> 8.1.5 (Rolldown) - vite-plugin-vue-devtools 8.1.2 -> 8.2.1 These are coupled: @nuxt/vite-builder@4.5.1 depends on vite ^8.1.5, so nuxt 4.5 cannot be taken without vite 8. nitropack, vite-ssg, @vitejs/plugin-vue and @nuxt/devtools are already on their newest releases and are unchanged. vite-ssg 28.3.0 accepts vite ^8.0.0-0, and packages/card-payment, the only consumer, builds clean. Nuxt 4.5 moves its own unhead dependency from ^2.1.15 to ^3.1.8, so the tree now carries @unhead/vue 2.1.15 (catalog, used by packages/card-payment) and 3.2.3 (via nuxt) side by side. That is expected: card-payment is a separate vite-ssg app, not Nuxt, and unhead 3 is still a held-back major for it. Needed the ref-shadowing fix in the preceding commit to build at all.
|
On the duplicated unhead, for the record: this cannot be collapsed today. Moving the catalog to 3 would also be actively wrong rather than merely useless: card-payment's Verified the current state is working: card-payment resolves |
Batch 4 of the renovate dashboard (#169): the coupled Nuxt + Vite upgrade.
They genuinely are coupled:
@nuxt/vite-builder@4.5.1depends onvite ^8.1.5, so Nuxt 4.5 cannot be taken without Vite 8.nitropack,vite-ssg,@vitejs/plugin-vueand@nuxt/devtoolsare already on their newest releases and are unchanged here.The interesting part: a Rolldown miscompilation
Vite 8 broke the build.
nuxi generateaborted with a bare[500] Server Erroron/sponsor/mintand nothing else, no stack. The underlying error turned out to beReferenceError: ref is not defined, raised inuseRotkiSponsorshipPayment.The cause is ours, and it is worth knowing about.
use-payment.tshad aContractRefparameter and a local both namedref, shadowing therefauto-imported from vue. Rolldown spots the inner bindings, renames the imported one toref$1to dodge the collision, and then fails to rewrite two call sites in the enclosing scope:11 of the 13 call sites were rewritten to
ref$1; two were not. Under Vite 7 / rollup the import was never renamed, so the shadowing was harmless and this stayed latent.The fix is in a separate commit and does not depend on the bundler being wrong: shadowing
refis something the code should not have been doing. Locals are renamed tocontractRefandreferral. I swept the whole workspace for locals shadowing vue auto-imports (ref,computed,watch,shallowRef,reactive, …) and these five sites were the only ones:app/modules/web3/sponsorship/use-payment.ts(the one that broke)app/modules/web3/sponsorship/actions.ts(two params)app/components/products/ProductsButtons.vueapp/modules/checkout/components/method/PaymentMethodSelection.vuetests/unit/modules/web3/client.spec.tsunhead now doubles up
Nuxt 4.5 moves its own unhead dependency from
^2.1.15to^3.1.8, so the tree carries@unhead/vue2.1.15 (catalog, used bypackages/card-payment) and 3.2.3 (via nuxt) side by side. That is expected rather than a mistake: card-payment is a separate vite-ssg app, not Nuxt, and unhead 3 is still a held-back major for it. Worth folding into the eventual unhead 3 batch.Also here
.nuxtrcis a tracked file that@nuxt/test-utilsrewrites on install. The 4.0.3 → 4.1.0 bump landed in #648 but the regenerated file was not committed with it, so it is picked up here in its own commit.Verification
typecheckclean,lintclean (68 pre-existing warnings, 0 errors), 476 tests pass.generatebuilds 181 pages and 155 OG images, sitemap still 170 URLs./sponsor/mintnow prerenders to real markup (72 KB) with no error payload in it.packages/card-paymentbuilds clean on Vite 8 with vite-ssg 28.3.0.