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
With the latest vite-plugin-svelte / 3.0.1 / Svelte 4.2.8 / Vite 5.0.10 / svelte-preprocess 5.1.2 there is a situation for voluminous warning messages generated. I have an investigation into the code points where this is generated in vite-plugin-svelte and have narrowed things down. The main cause / symptom is using Sass in Svelte components via <style lang="scss"></style> blocks. Convert things over to normal CSS <style></style> and the warnings go away.
With the latest 3.0.x release checking of dependencies output by the Svelte compiler / preprocessor was added in src/utils/preprocess.js via the new checkPreprocessDependencies function. I tracked the issue through svelte-preprocess and it appears the problem is in the scss transformer as it does file path comparisons between Posix & Windows paths thus not being equal thereby adding an erroneous "dependency". Quite possibly other transformers are also doing path comparisons incorrectly.
I figured it might be a good idea to open an issue here as well since this likely will be something that comes up for many potentially using Windows. I only found the related issue in svelte-preprocess after tracing things for 1+ hours. The problem is in svelte-preprocess, but is exposed by the latest vite-plugin-svelte.
This is not a bug in vite-plugin-svelte. To silence the warning until a fix has been made in svelte-preprocess, you can use onwarn in the config and ignore the code vite-plugin-svelte-preprocess-depends-on-self
Yeah.. Apologies for the churn. I figured it would be good to at least have something in the issues here as it is not clear where the bug occurs. I spent a good bit of time tracing it back to svelte-preprocess through the Vite plugin code; over an hour of time. Having it in the issues here might help someone else doing the same. I checked various Svelte repos initially for existing issues, but svelte-preprocess was not an obvious one to check.
Describe the bug
Greets,
With the latest
vite-plugin-svelte
/3.0.1
/ Svelte4.2.8
/ Vite5.0.10
/ svelte-preprocess5.1.2
there is a situation for voluminous warning messages generated. I have an investigation into the code points where this is generated invite-plugin-svelte
and have narrowed things down. The main cause / symptom is using Sass in Svelte components via<style lang="scss"></style>
blocks. Convert things over to normal CSS<style></style>
and the warnings go away.With the latest
3.0.x
release checking of dependencies output by the Svelte compiler / preprocessor was added insrc/utils/preprocess.js
via the newcheckPreprocessDependencies
function. I tracked the issue throughsvelte-preprocess
and it appears the problem is in thescss
transformer as it does file path comparisons between Posix & Windows paths thus not being equal thereby adding an erroneous "dependency". Quite possibly other transformers are also doing path comparisons incorrectly.I figured it might be a good idea to open an issue here as well since this likely will be something that comes up for many potentially using Windows. I only found the related issue in
svelte-preprocess
after tracing things for 1+ hours. The problem is insvelte-preprocess
, but is exposed by the latestvite-plugin-svelte
.Related: sveltejs/svelte-preprocess#619
Reproduction URL
https://github.com/richardfxr/sveltekit2-preprocess-dependency-issue
Reproduction
I used another fellows reproduction case from
svelte-preprocess
/ Issue619
. I verified that I see the same result.svelte-preprocess
withscss
style block in Svelte componentsIn the repo linked run
npm run build
and you'll see the warnings on a Windows box.Logs
No response
System Info
The text was updated successfully, but these errors were encountered: