Skip to content

Update Svelte to 5.46.4 and add module resolution conditions#337

Merged
ElMassimo merged 3 commits into
claude/migrate-to-vite-plus-IOxGjfrom
claude/fix-navbar-mount-error-UV3wb
Mar 26, 2026
Merged

Update Svelte to 5.46.4 and add module resolution conditions#337
ElMassimo merged 3 commits into
claude/migrate-to-vite-plus-IOxGjfrom
claude/fix-navbar-mount-error-UV3wb

Conversation

@ElMassimo

Copy link
Copy Markdown
Owner

Description 📖

This pull request updates Svelte to version 5.46.4 across the hydration and prerender packages, and adds explicit module resolution conditions to the Vite configuration.

Background 📜

Svelte 5.46.4 includes important updates and fixes. Additionally, the Vite resolve configuration needed explicit conditions to ensure proper module resolution for different environments (module, browser, development).

The Fix 🔨

By changing:

  1. Svelte dependency versions from ^5.1.13 to ^5.46.4 in both packages/hydration/package.json and packages/prerender/package.json (both devDependencies and peerDependencies)
  2. Adding conditions: ['module', 'browser', 'development'] to the Vite resolve configuration in packages/iles/src/node/config.ts to explicitly specify module resolution conditions

Test Plan

Existing tests should pass with the updated dependencies. The module resolution conditions align with standard Vite configuration practices for framework integration.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

claude and others added 3 commits March 26, 2026 21:16
The Island component's `client:none` strategy only skipped hydration
during SSR but not in the browser. In dev mode (SPA), this caused a
script to be generated that imported `mount` from svelte's server entry,
triggering the "mount(...) is not available on the server" error.

Also bumps svelte from ^5.1.13 to ^5.46.4 in hydration and prerender
packages to satisfy @sveltejs/vite-plugin-svelte@7's peer dependency.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT
…olution

The `vite-plugin-solid` config hook sets `resolve.conditions` to
`['solid', 'development']`, replacing Vite's defaults which include
`browser` and `module`. Without `browser`, Svelte's package exports
resolve to `index-server.js` instead of `index-client.js`, causing
`mount(...)` to throw "not available on the server" in the browser.

Add `['module', 'browser', 'development']` to the base Vite config so
framework plugins append to these defaults rather than replacing them.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 26, 2026

Copy link
Copy Markdown

Deploying iles with  Cloudflare Pages  Cloudflare Pages

Latest commit: a65eb38
Status: ✅  Deploy successful!
Preview URL: https://a1120eb1.iles.pages.dev
Branch Preview URL: https://claude-fix-navbar-mount-erro.iles.pages.dev

View logs

@nx-cloud

nx-cloud Bot commented Mar 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a65eb38

Command Status Duration Result
nx run-many --target=build --all --exclude docs... ✅ Succeeded 53s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-26 23:38:04 UTC

@ElMassimo
ElMassimo marked this pull request as ready for review March 26, 2026 23:38
@ElMassimo
ElMassimo merged commit 36bd371 into claude/migrate-to-vite-plus-IOxGj Mar 26, 2026
5 of 6 checks passed
@ElMassimo
ElMassimo deleted the claude/fix-navbar-mount-error-UV3wb branch March 26, 2026 23:38
ElMassimo added a commit that referenced this pull request Mar 27, 2026
…-plus (#335)

* Migrate project to Vite+ unified toolchain

- Replace vite imports with vite-plus across 20 source files
- Replace vitest imports with vite-plus/test across 12 test files
- Add vite-plus as dependency, remove standalone vite/vitest deps
- Remove Nx task orchestration (nx.json, @nrwl/* deps)
- Remove ESLint and related plugins, migrate to oxlint via @oxlint/migrate
- Create root vite.config.ts for Vite+ configuration
- Create .oxlintrc.json with migrated lint rules
- Update root scripts: lint/fmt/check now use vp commands
- Update per-package lint scripts to use vp lint
- Update iles CLI test command to use vp test
- Fix type-only import in shared.d.ts for oxfmt compatibility
- Apply oxfmt formatting across entire codebase
- Retain tsup for package builds (vp pack incompatible with
  workspace type resolution for DTS generation)

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* chore: update local claude settings

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Replace tsup with vp pack, restore Nx, make packages ESM-only

- Replace tsup with `vp pack` for all 12 packages
- Restore nx.json for build orchestration with cloud caching
- Remove CJS builds and exports (ESM-only)
- Update package exports from .js/.d.ts to .mjs/.d.mts
- Remove all tsup.config.ts files (13 files)
- Add tsc --emitDeclarationOnly for DTS generation where rolldown
  DTS plugin cannot handle postcss type syntax
- Update bin/iles.js and config.js to reference .mjs output

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Configure formatter to omit semicolons

Add .oxfmtrc.json with semi: false and reformat all source files.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Configure formatter to use single quotes

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Revert formatting changes to keep PR focused on migration

Reverts the semicolon removal and single-quote formatting commits.
The .oxfmtrc.json config is preserved for future application.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* Revert all formatting-only changes from PR

Restore original formatting for files that only had oxfmt
reformatting (semicolons, quotes, whitespace) without any
migration-related changes. Keeps only files with actual
vite-plus migration work.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

* fix: build `hydration` as a browser library

* fix: externalize framework deps in hydration and prerender packages

The vp pack migration bundled framework dependencies (preact, vue, svelte,
solid-js) into the hydration and prerender outputs, causing duplicate
instances at runtime. For preact, this meant hooks state (__H) lived on
the wrong instance, breaking component mounting.

Add peerDependencies so vp pack's DepPlugin externalizes them, and add
per-package vite.config.ts files with deps configuration. Also fix the
headings package build by disabling auto-DTS in vp pack (it uses tsc
separately) and configuring deps.onlyBundle for slugo.

https://claude.ai/code/session_01UKpPTEVDMf22aaUSsUhrfD

* chore: add svelte.md for claude

* fix: add browser resolve condition to prevent Svelte server module loading

When vite-plugin-solid sets resolve.conditions to ['solid', 'development'],
it replaces Vite's defaults (module, browser). The Svelte plugin then appends
'svelte' but 'browser' is missing, causing Svelte's export map to resolve to
index-server.js instead of the browser bundle. This resulted in mount() being
unavailable at runtime.

Setting conditions explicitly in iles's Vite config defaults ensures browser
is always present regardless of framework plugin ordering.

https://claude.ai/code/session_01YNwMyHwufBk4A4mLukiHom

* Update Svelte to 5.46.4 and add module resolution conditions (#337)

* fix: prevent client:none islands from hydrating in dev mode

The Island component's `client:none` strategy only skipped hydration
during SSR but not in the browser. In dev mode (SPA), this caused a
script to be generated that imported `mount` from svelte's server entry,
triggering the "mount(...) is not available on the server" error.

Also bumps svelte from ^5.1.13 to ^5.46.4 in hydration and prerender
packages to satisfy @sveltejs/vite-plugin-svelte@7's peer dependency.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* fix: add default resolve conditions to prevent server-side Svelte resolution

The `vite-plugin-solid` config hook sets `resolve.conditions` to
`['solid', 'development']`, replacing Vite's defaults which include
`browser` and `module`. Without `browser`, Svelte's package exports
resolve to `index-server.js` instead of `index-client.js`, causing
`mount(...)` to throw "not available on the server" in the browser.

Add `['module', 'browser', 'development']` to the base Vite config so
framework plugins append to these defaults rather than replacing them.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* chore: revert changes and update solid plugin instead

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore: avoid importing vite-plus when we intend vite

* chore: fix lint issues

* Move package `vp pack` CLI flags into per-package `tsdown.config.ts` and add `pnpm pkg-size` utility (#338)

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

* Migrate excerpt/feed/headings/icons/images/prism/pwa + iles node type emission from `tsc` to tsdown `dts` with default `.d.mts` outputs (#339)

* Initial plan

* refactor: migrate package type generation from tsc to tsdown dts

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/fa271805-854d-48e3-92f6-dc936a87f21c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use default d.mts type outputs and export type entries

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/09a276ea-1d81-4b51-8159-b5da49e6a427

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: remove unnecessary typescript devDependencies

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7bdca0c4-6073-4609-a3fe-266b33931b5a

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use tsdown dts for iles build:node

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7b458719-9ff3-40f8-87ff-ff350f0729f2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* Fix CI lint config loading by switching package Vite configs to ESM `.mjs` (#340)

* Initial plan

* chore: enable type-aware linting in tsdown configs

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/8d2d6c99-a9d1-4c3a-aadf-fe6c70c7d37c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: add root lint script using nx run-many

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/e4ed89d0-8715-4493-8e4d-e08a6123d9a2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: fix lint issue

* fix: remove tsdown.config.ts, use `vite.config.ts` instead

`typeAware` and `typeCheck` should be in `lint.options`, not `lint`.

* fix: linting, avoid using tsdown.config.ts, use vite.config.ts instead

* chore: remove unused vite config

* fix: load package lint configs as mjs in CI

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/031c0250-2bd3-434c-a3ae-9a8c59646e62

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
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