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
This commit is what sets this repository apart from a regular skeleton app created with create-svelte@next.
Logs
10:42:02 PM [vite-plugin-svelte] /home/illright/work/sveltekit-bug-vite-define/src/routes/index.svelte:1:16 'vite' is not defined. Consider adding a <script> block with 'export let vite' to declare a prop
Unexpected token (6:118)
SyntaxError: Unexpected token (6:118)
at Object.pp$5.raise (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:47485:13)
at Object.pp.unexpected (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:44810:8)
at Object.pp.expect (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:44804:26)
at Object.pp$4.parseObj (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:47097:12)
at Object.pp$4.parseExprAtom (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:46836:17)
at Object.pp$4.parseExprSubscripts (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:46652:19)
at Object.pp$4.parseMaybeUnary (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:46618:17)
at Object.parseMaybeUnary (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:49793:29)
at Object.pp$4.parseExprOps (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:46551:19)
at Object.pp$4.parseMaybeConditional (/home/illright/work/sveltekit-bug-vite-define/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-36bf480c.js:46534:19)
This particularly happens in SvelteKit – when I tried to reproduce the bug with a regular Svelte + Vite app created by create-vite, everything worked out well.
The text was updated successfully, but these errors were encountered:
Describe the bug
Normally,
vite.define
allows you to specify constant replacements for tokens in source code.For some reason, whenever there's a non-empty style tag present in the file which is to undergo replacement, the page fails with a syntax error.
Reproduction
https://github.com/illright/sveltekit-bug-vite-define
This commit is what sets this repository apart from a regular skeleton app created with
create-svelte@next
.Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
This particularly happens in SvelteKit – when I tried to reproduce the bug with a regular Svelte + Vite app created by
create-vite
, everything worked out well.The text was updated successfully, but these errors were encountered: