You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any environment that loads the published JS through Node's native module loader (e.g. Vitest by default) fails, because Node has no loader for .svg: TypeError: Unknown file extension ".svg"
Workaround that we use: force the package through the bundler's asset pipeline (in Vitest config, test.server.deps.inline: [/@stratakit\/(mui|icons)/]).
Additional issue on Windows only:
Vite shipped a security fix in 8.0.16 #22572 (GHSA-fx2h-pf6j-xcff) that rejects any file path containing ~ on Windows.
The workaround above for Vitest (deps.inline) routes every @stratakit/mui module through Vite's per-file pipeline, which now rejects dist/DEV/~createTheme.js and all other files that start with ~. So once the package is inlined, loading these files on Windows fails with:
Describe the bug
@stratakit/muipackaging issue causing downstream bundler/test failuresIssue —
dist/Icon.jsuses hardcoded static.svgimportsdist/Icon.jscontains static imports of.svgfiles:Any environment that loads the published JS through Node's native module loader (e.g. Vitest by default) fails, because Node has no loader for
.svg:TypeError: Unknown file extension ".svg"Workaround that we use: force the package through the bundler's asset pipeline (in Vitest config,
test.server.deps.inline: [/@stratakit\/(mui|icons)/]).Additional issue on Windows only:
Vite shipped a security fix in 8.0.16 #22572 (GHSA-fx2h-pf6j-xcff) that rejects any file path containing
~on Windows.The workaround above for Vitest (
deps.inline) routes every@stratakit/muimodule through Vite's per-file pipeline, which now rejectsdist/DEV/~createTheme.jsand all other files that start with~. So once the package is inlined, loading these files on Windows fails with:This is
~issue is Windows-only, with the workaround being disablingserver.fs.strictin vite config for vitest.Note: this
~issue only comes up because the.svgissue forces inlining in the first place.Summary of workarounds required:
deps.inline→ to resolve the.svgimports, which thenserver.fs.strict: false(scoped to tests) → to get past the~filename rejection that setup monorepo #1 exposes.Steps to reproduce
@stratakit/mui@0.4.1in a Vite 8.0.16 + Vitest 4.1.9 project on Windows.@stratakit/mui.deps.inline→Unknown file extension ".svg".deps.inlinebutfs.strictenabled →Cannot find module '.../~createTheme.js'.Expected behavior
Would be great to run Vitest without multiple config workarounds, or at the least we should document these workarounds on https://stratakit.bentley.com/docs/getting-started/develop as Vitest is a very common tool.
Link to minimal reproduction
stackblitz is currently broken for vite 8.x, will post when fixed, see stackblitz/webcontainer-core#2104
Environment and versions
@stratakit/icons)~filename issue)Additional context
No response