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
After some more testing, I realized that the mere presence of the <style> string within <script>, even if in a string (or a comment!!) causes the vite-plugin-svelte plugin to crash with the following error:
Reproduction
<script>
// export const value = '<style>test</style>';
</script>
<div>test</div>
Logs
Please include browser console and server logs around the time this bug occurred.
Error while preprocessing {filePath}.svelte - {filePath}:1:1: Unknown word
CssSyntaxError: Error while preprocessing {filePath}.svelte - {filePath}.svelte:1:1: Unknown word
at Input.error (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/input.js:148:16)
at Parser.unknownWord (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/parser.js:540:22)
at Parser.other (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/parser.js:164:12)
at Parser.parse (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/parser.js:72:16)
at parse (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/parse.js:11:12)
at new LazyResult (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/lazy-result.js:133:16)
at Processor.process (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/postcss/lib/processor.js:28:14)
at transformer (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/svelte-preprocess/dist/transformers/globalStyle.js:56:72)
at transform (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/svelte-preprocess/dist/autoProcess.js:37:12)
at async style (/Users/samijaber/code/work/builder/examples/svelte/sveltekit/node_modules/svelte-preprocess/dist/autoProcess.js:191:33)
To Reproduce
To help us help you, if you've found a bug please consider the following:
Describe the bug
I was initially trying to build this component and ran into errors:
After some more testing, I realized that the mere presence of the
<style>
string within<script>
, even if in a string (or a comment!!) causes thevite-plugin-svelte
plugin to crash with the following error:Reproduction
Logs
Please include browser console and server logs around the time this bug occurred.
To Reproduce
To help us help you, if you've found a bug please consider the following:
Expected behavior
This should be valid Svelte code as it works fine in the Svelte REPL
Information about your project:
The text was updated successfully, but these errors were encountered: