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
In a basic Kit set up, when using Vite define static replacement globals, if a <style> tag is present in the file where the global is used, a 500 is returned and the app breaks on npm run dev.
git clone https://github.com/arxpoetica/sveltekit-6qwj7g.git
cd sveltekit-6qwj7g
npm install
npm run dev
Logs
7:09:31 PM [vite-plugin-svelte] /Users/robert/Documents/@workspace/svelte-project/bugs/sveltekit-6qwj7g/src/routes/index.svelte:1:18 '__TESTING__' is not defined. Consider adding a <script> block with 'export let __TESTING__' to declare a prop
7:09:31 PM [vite-plugin-svelte] /Users/robert/Documents/@workspace/svelte-project/bugs/sveltekit-6qwj7g/src/routes/index.svelte:2:6 '__TESTING__' is not defined. Consider adding a <script> block with 'export let __TESTING__' to declare a prop
Parse failure: Unexpected token (6:120)
Contents of line 6: map: "{\"version\":3,\"file\":\"index.svelte\",\"sources\":[\"index.svelte\"],\"sourcesContent\":[\"<div>{console.log("testing")}</div>\\n<div>{"testing"}</div>\\n\\n<style>\\n\\tdiv {\\n\\t\\tcolor: red;\\n\\t}\\n *{}</style>\\n\"],\"names\":[],\"mappings\":\"AAIC,GAAG,eAAC,CAAC,AACJ,KAAK,CAAE,GAAG,AACX,CAAC,AACD,eAAC,EAAE\"}"
Error: Parse failure: Unexpected token (6:120)
Contents of line 6: map: "{\"version\":3,\"file\":\"index.svelte\",\"sources\":[\"index.svelte\"],\"sourcesContent\":[\"<div>{console.log("testing")}</div>\\n<div>{"testing"}</div>\\n\\n<style>\\n\\tdiv {\\n\\t\\tcolor: red;\\n\\t}\\n *{}</style>\\n\"],\"names\":[],\"mappings\":\"AAIC,GAAG,eAAC,CAAC,AACJ,KAAK,CAAE,GAAG,AACX,CAAC,AACD,eAAC,EAAE\"}"
at ssrTransform (/Users/robert/Documents/@workspace/svelte-project/bugs/sveltekit-6qwj7g/node_modules/vite/dist/node/chunks/dep-55830a1a.js:55904:15)
at doTransform (/Users/robert/Documents/@workspace/svelte-project/bugs/sveltekit-6qwj7g/node_modules/vite/dist/node/chunks/dep-55830a1a.js:56746:48)
Describe the bug
In a basic Kit set up, when using Vite
define
static replacement globals, if a<style>
tag is present in the file where the global is used, a 500 is returned and the app breaks onnpm run dev
.Reproduction
Reproduction here:
https://github.com/arxpoetica/sveltekit-6qwj7g
https://stackblitz.com/edit/sveltekit-6qwj7g?file=src%2Froutes%2Findex.svelte
To reproduce:
Logs
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: