Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite SSR Errors #121

Closed
hughess opened this issue Sep 3, 2021 · 6 comments · Fixed by #160
Closed

Vite SSR Errors #121

hughess opened this issue Sep 3, 2021 · 6 comments · Fixed by #160
Labels
bug Something isn't working

Comments

@hughess
Copy link
Member

hughess commented Sep 3, 2021

Several users are seeing errors from Vite related to SSR. These issues are detailed here: sveltejs/kit#2086. One example is vitejs/vite#3953.

There should be a workaround until those are fixed by using older package versions, which work for running an Evidence project. Specific versions to be added to docs.

@mrshu
Copy link

mrshu commented Oct 14, 2021

Hi @hughess ,

I just tried to boot up evidence and ended up running into the following:

23:27:36 [vite-plugin-svelte] /Users/mrshu/work/mrshu/my-proje/node_modules/@evidence-dev/components/ui/LoadingIndicator.svelte:42:1 Unused CSS selector ":global(html).dark .fade"
23:27:38 [vite] Error when evaluating SSR module /node_modules/@evidence-dev/db-orchestrator/index.cjs:
ReferenceError: require is not defined
    at /node_modules/@evidence-dev/db-orchestrator/index.cjs:1:95
    at instantiateModule (/Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:66472:15)
Line must be greater than or equal to 1, got -1
TypeError: Line must be greater than or equal to 1, got -1
    at BasicSourceMapConsumer.SourceMapConsumer_findMapping [as _findMapping] (/Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:65336:13)
    at BasicSourceMapConsumer.SourceMapConsumer_originalPositionFor [as originalPositionFor] (/Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:65405:22)
    at /Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:66344:34
    at String.replace (<anonymous>)
    at /Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:66334:21
    at Array.map (<anonymous>)
    at ssrRewriteStacktrace (/Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:66333:10)
    at instantiateModule (/Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/node_modules/vite/dist/node/chunks/dep-713b45e1.js:66475:28)
Unexpected token T in JSON at position 0
SyntaxError: Unexpected token T in JSON at position 0
    at JSON.parse (<anonymous>)
    at Proxy.<anonymous> (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:839:22)
    at async load (/Users/mrshu/work/mrshu/my-proje/src/pages/firstquery.md:32:19)
    at async load_node (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:867:12)
    at async respond$1 (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:1118:15)
    at async render_page (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:1272:20)
    at async resolve (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:1617:10)
    at async respond (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/ssr.js:1592:10)
    at async Immediate.<anonymous> (file:///Users/mrshu/work/mrshu/my-proje/node_modules/@sveltejs/kit/dist/chunks/index.js:3458:22)
23:27:39 [vite-plugin-svelte] /Users/mrshu/work/mrshu/my-proje/node_modules/@evidence-dev/components/ui/LoadingIndicator.svelte:42:1 Unused CSS selector ":global(html).dark .fade"

Would you say it's the same thing? is there anything I can do to fix it?

Thanks a bunch!

@hughess
Copy link
Member Author

hughess commented Oct 22, 2021

Hi @mrshu, really sorry for the delay. I just realized that my GitHub notifications were turned off and I've been missing things - got them back on now!

Unfortunately we ran into an issue this week with one of our package dependencies which has broken our installer. This has happened a few times in the past, so rather than doing a quick fix we are putting together a more sustainable solution. We should have a more stable version released sometime next week, so it's probably best to wait until then to try installing again.

Sorry about this! I'll follow up with you when we have the working version available.

@mrshu
Copy link

mrshu commented Oct 23, 2021

Thanks for the reply @hughess!

Let me just say that I very much like evidence as a concept and the reason why I was installing it was that I wanted to make it work with Athena too, as I could then try it out with some databases straight away.

Hence, thanks a bunch for putting this together and please do let me know when the working version becomes available!

@mrshu
Copy link

mrshu commented Oct 28, 2021

@hughess any update here?

@hughess
Copy link
Member Author

hughess commented Oct 28, 2021

@mrshu we're still working on the fix, but should have something soon! Sorry it's taking some time - it's a more complicated issue than we initially realized. I'll send you a message as soon as we have it available.

Happy to hear you really like the concept! I haven't used Athena before, but it sounds like a great product and would be cool to have it connected in an Evidence project.

@hughess
Copy link
Member Author

hughess commented Nov 10, 2021

@mrshu good news - we've just released a fixed version, so you should be able to get started with it! Let me know if you run into any issues and I can help out. Thanks a ton for your patience on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants