Skip to content

feat: nuxt 4 upgrade#3366

Merged
jagoral merged 5 commits intov2-developfrom
feat/nuxt4-upgrade
Feb 17, 2026
Merged

feat: nuxt 4 upgrade#3366
jagoral merged 5 commits intov2-developfrom
feat/nuxt4-upgrade

Conversation

@jagoral
Copy link
Copy Markdown
Contributor

@jagoral jagoral commented Feb 17, 2026

Related issue

Closes #

Scope of work

  • Upgrade to Nuxt 4 (nuxt@^4.3.0) while maintaining backward compatibility with Nuxt 3
  • Upgrade Node.js requirement to v22 LTS (.nvmrc22.14.0, engines → >=22.0.0) — required by Vite 7.3.1 (crypto.hash() API needs Node >= 21.7)
  • Isolate Nuxt 4 workspace deps (hoistingLimits: "workspaces" on preview/nuxt) to prevent @nuxt/kit@4, @nuxt/vite-builder@4, and Vite 7 from leaking into the docs build (still on Nuxt 3)
  • Pin nitropack@2.10.3 to avoid impound/cookie-es incompatibility with Nuxt 3's import protection rules
  • Add svgo as explicit root devDependency (was previously resolved via accidental hoisting)

Important

I didn't upgrade docs, they still use Nuxt 3 (because sf-docs-base requires Nuxt 3). Because of that I needed to add few workarounds.

Screenshots of visual changes

N/A - no visual changes

Checklist

  • Self code-reviewed
  • Changes documented
  • Semantic HTML
  • SSR-friendly
  • Caching friendly
  • a11y for WCAG 2.0 AA
  • examples created
  • blocks created
  • cypress tests created

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: 2565a82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@storefront-ui/nuxt Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

jagoral and others added 3 commits February 17, 2026 11:21
Vite 7.3.1 (required by Nuxt 4.3.1) uses crypto.hash() which needs
Node.js >= 21.7.0. Updated .nvmrc and engines field accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Nuxt 4 upgrade introduced Vite 7.3.1 into the workspace which
was leaking into the docs app (still on Nuxt 3) during CI resolution,
causing a "nitro.client.mjs not found" build error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add hoistingLimits to preview/nuxt workspace so Nuxt 4 deps
  (@nuxt/kit, @nuxt/vite-builder, vite 7) stay isolated and don't
  pollute the root node_modules
- Pin nitropack to 2.10.3 (root resolution + docs devDep) to avoid
  impound/cookie-es incompatibility with Nuxt 3's import protection
- Add svgo as root devDependency (was previously resolved via hoisting)
- Pin nitropack and vite in docs devDeps for explicit version control

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +5 to +7
"installConfig": {
"hoistingLimits": "workspaces"
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(docs in workspaces issue)

Without it, Nuxt 4's @nuxt/kit@4.3.1, @nuxt/vite-builder@4.3.1, and vite@7.3.1 were hoisted to root node_modules, where nuxi would pick them up for the docs build instead of the correct Nuxt 3 versions

Comment thread package.json
"@storefront-ui/typography": "workspace:*",
"@changesets/assemble-release-plan@^6.0.4": "patch:@changesets/assemble-release-plan@npm%3A6.0.4#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.4-999d754646.patch"
"@changesets/assemble-release-plan@^6.0.4": "patch:@changesets/assemble-release-plan@npm%3A6.0.4#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.4-999d754646.patch",
"nitropack": "2.10.3"
Copy link
Copy Markdown
Contributor Author

@jagoral jagoral Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(docs in workspaces issue)

the lockfile update bumped nitropack from 2.10.3 → 2.13.1, which added utils.azure.mjs importing cookie-es. Nuxt 3's impound plugin blocks this import because the regex pattern doesn't account for nitropack/node_modules/ paths.

Was previously resolved via hoisting from apps/preview/nuxt, now
needs to be an explicit devDependency after hoisting isolation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@Szymon-dziewonski Szymon-dziewonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for this update!

@jagoral jagoral merged commit c8d40cc into v2-develop Feb 17, 2026
14 checks passed
@jagoral jagoral deleted the feat/nuxt4-upgrade branch February 17, 2026 11:36
FRSgit added a commit that referenced this pull request Feb 20, 2026
nuxt 4 upgrade (#3366)
fix: upgrade Node.js to v22 LTS for Vite 7 compatibility
fix: pin vite 5 for docs app to prevent Nuxt 3/Vite 7 conflict
fix: isolate Nuxt 4 deps to prevent leaking into docs build
fix: add missing eslint-plugin-nuxt dependency
docs: update figma file link (#3370)
This was referenced Feb 25, 2026
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

Successfully merging this pull request may close these issues.

2 participants