jakobrosenberg / svelte-prism

35 stars 7 forks source link

`line` must be greater than 0 (lines start at line 1) (sveltekit) #36

Open LeoDog896 opened 2 years ago

LeoDog896 commented 2 years ago

I'm getting a weird error on SvelteKit:


window is not defined
`line` must be greater than 0 (lines start at line 1)
Error: `line` must be greater than 0 (lines start at line 1)
    at originalPositionFor$1 (/home/leodog896/Documents/GitHub/svelte-tilt/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:1780:19)
    at /home/leodog896/Documents/GitHub/svelte-tilt/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:59183:25
    at String.replace (<anonymous>)
    at /home/leodog896/Documents/GitHub/svelte-tilt/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:59173:21
    at Array.map (<anonymous>)
    at ssrRewriteStacktrace (/home/leodog896/Documents/GitHub/svelte-tilt/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:59172:10)
    at Object.ssrRewriteStacktrace (/home/leodog896/Documents/GitHub/svelte-tilt/node_modules/vite/dist/node/chunks/dep-e1fc1d62.js:59912:20)
    at fix_stack_trace (file:///home/leodog896/Documents/GitHub/svelte-tilt/node_modules/@sveltejs/kit/dist/chunks/index.js:175:31)
    at Object.get (file:///home/leodog896/Documents/GitHub/svelte-tilt/node_modules/@sveltejs/kit/dist/chunks/index.js:309:21)
    at Object.hooks.handleError (file:///home/leodog896/Documents/GitHub/svelte-tilt/node_modules/@sveltejs/kit/dist/chunks/index.js:243:20)
    ```.

I assume that it's because the module isn't SSR compatible.
yousufiqbal commented 2 years ago

Same here..

kuchaguangjie commented 2 years ago

Same here

jakobrosenberg commented 2 years ago

1.1.6 is out. Please let me know if this is still an issue.