Skip to content

chore: bump svelte-preprocess 6.0.3 -> 6.0.4 (deferred from #236) #238

Description

@dobby-coder

Deferred from PR #237. The 6.0.4 release would let us drop the local --legacy-peer-deps workaround (it widens peerOptional typescript to ^5.0.0 || ^6.0.0), but the same release rewrote the TypeScript processor's dynamic import in a way that breaks vite-plugin-svelte's preprocess step.

Symptom

npm run build fails on every .svelte file with a <script lang="ts"> block:

[plugin vite-plugin-svelte:preprocess] /.../src/routes/(marketing)/+layout.svelte
RolldownError: Cannot find module '/.../node_modules/svelte-preprocess/dist/transformers/typescript'
imported from /.../node_modules/svelte-preprocess/dist/autoProcess.js

Root cause

dist/processors/typescript.js changed between 6.0.3 and 6.0.4:

-const { transformer } = await Promise.resolve().then(() => __importStar(require('../transformers/typescript')))
+const { transformer } = await import('../transformers/typescript.js')

The new dynamic ESM-style import() in a CJS package ("type": "commonjs") isn't resolving correctly when invoked through vite-plugin-svelte's preprocess pipeline — the error path strips the .js suffix at resolution time. Likely an upstream bug in svelte-preprocess.

What to do

  • Wait for a 6.0.5 release that either reverts the dynamic-import change or fixes the resolution path.
  • When retrying, run npm install svelte-preprocess@<v>, drop the manifest pin, and verify npm run build succeeds on a clean checkout before pushing.
  • If/when this lands, the repo can also drop the --legacy-peer-deps install workaround (6.0.4+ accepts typescript ^6).

Upstream

No issue filed at sveltejs/svelte-preprocess yet — worth a search before reproducing.

Metadata

Metadata

Assignees

Labels

dependenciesPull requests that update a dependency file

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions