-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling
Description
Describe the bug
I've recently had problems with some component snapshot tests that fail on CI because Svelte generates different CSS hashes on the CI runner than on my local machine.
This seems to be caused by the introduction of filename based CSS hashing in #16740. It appears that in some cases the cssHash function is given an absolute filename which then leads to different hashes on CI vs. dev because the parent directories are different.
It should be noted that i was only able to reproduce when using internal workspace dependencies (using the workspace: protocol) in a pnpm monorepo.
It would be great if the cssHash would not change based on environment details like parent directories and reading #16636 it appears that this was the intention.
Reproduction
- open the reproduction example on Stackblitz
- wait until the
pnpm --dir webapp testcommand finishes in the terminal - the output should contain a
cssHash filename:line followed by an absolute path. the line is produced by an overriddencompilerOptions.cssHashfunction inwebapp/svelte.config.js
Logs
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpmSeverity
annoyance
dtl
Metadata
Metadata
Assignees
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling