Skip to content

Stryker Error: 'svelte/compiler' no longer exports a walk utility in svelte version 5+ #5154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jacq42 opened this issue Jan 23, 2025 · 5 comments
Labels
🐛 Bug Something isn't working

Comments

@jacq42
Copy link

jacq42 commented Jan 23, 2025

Summary

The svelte-parser.ts imports the (deprecated) walk function from svelte compiler:

const { parse: svelteParse, walk, preprocess, VERSION } = await import('svelte/compiler');

When running stryker mutation tests after updating, I got the error message:

 ERROR Stryker Unexpected error occurred while running Stryker Error: 'svelte/compiler' no longer exports a `walk` utility — please import it directly from 'estree-walker' instead
    at walk (file:///xxx/node_modules/svelte/src/compiler/index.js:163:8)
    at getTemplateScriptRanges (file:///xxx/node_modules/@stryker-mutator/instrumenter/dist/src/parsers/svelte-parser.js:51:9)
    at parse (file:///xxx/node_modules/@stryker-mutator/instrumenter/dist/src/parsers/svelte-parser.js:16:28)
    at async Instrumenter.instrument (file:///xxx/node_modules/@stryker-mutator/instrumenter/dist/src/instrumenter.js:33:25)
    at async MutantInstrumenterExecutor.execute (file:///xxx/node_modules/@stryker-mutator/core/dist/src/process/2-mutant-instrumenter-executor.js:26:34)
    at async Stryker.runMutationTest (file:///xxx/node_modules/@stryker-mutator/core/dist/src/stryker.js:33:48)

Stryker/Svelte/Test environment

+-- @stryker-mutator/[email protected]

Your Environment

software version(s)
node 22.12.0
npm 10.9.0
Operating System Mac Darwin 24.3.0
@jacq42 jacq42 added the 🐛 Bug Something isn't working label Jan 23, 2025
@jacq42
Copy link
Author

jacq42 commented Feb 11, 2025

Any updates for this bug?

How to use stryker.js with svelte 5?

@david-otten
Copy link

@simondel @nicojs

Do you have an eye on this? Is there a plan to migrate to svelte5?

@jacq42
Copy link
Author

jacq42 commented Apr 29, 2025

The update to Svelte v5 is included in this PR. But no one is assigned.

@Andreas02-dev
Copy link
Contributor

@david-otten @jacq42

We're currently working on it, and expect to release Svelte 5 support soon!

@Andreas02-dev
Copy link
Contributor

@jacq42 @david-otten

Thank you for your patience!
We have now released version 9.0.1 of StrykerJS which includes Svelte 5 support, so I will be closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants