我已经使用此 tutorial 成功运行了 superbase 和 svelte 。然而,我确实需要 sveltkit,而不是基于 svelte 模板。当我尝试使用基于 sveltkit 项目的 superbase 时,出现以下错误
11:50:01 [vite] Error when evaluating SSR module /src/superbaseClient.js:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
11:50:01 [vite] Error when evaluating SSR module /src/routes/sbase.svelte:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
__api is not defined
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
我已尝试
使用 sveltkit 入门说明
-
按照 superbase 但将 svelte 模板的使用替换为sveltekit 项目。
-
使用https://github.com/supabase-community/svelte-supabase<安装了superbase< /a>
-
我忽略了指南中有关安装汇总插件的行,因为我相信它们已被 svelte 套件覆盖。
github 上的项目提供了更多代码。我尝试让它工作的所有失败尝试的代码都可以在该存储库上名为“add superbase”的分支中找到
I have successfully run superbase with svelte using this tutorial . However I really need the sveltkit rather than basing it on the svelte template . When I try to use superbase based on a sveltkit project I get the following error
11:50:01 [vite] Error when evaluating SSR module /src/superbaseClient.js:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
11:50:01 [vite] Error when evaluating SSR module /src/routes/sbase.svelte:
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
__api is not defined
ReferenceError: __api is not defined
at /src/superbaseClient.js:3:21
at async instantiateModule (/Users/bob/Documents/dev/javascript/svelte/svelteBp/node_modules/vite/dist/node/chunks/dep-971d9e33.js:56177:9)
I have tried
-
Created a new sveltkit project using the sveltkit getting started instructions
-
Followed the getting started instructions in superbase but replaced the use of the svelte template with a sveltekit project.
-
Installed superbase with https://github.com/supabase-community/svelte-supabase
-
I ignored the lines about installing the rollup plugins in the guide because I believe they are covered off by svelte kit.
More code is available for the whole project on the github. The code with all my failed attempts at getting it to work can be found in a branch on that repo called "add superbase"
发布评论
评论(1)
您可以尝试 Supabase Adder:https://github.com/supabase-community/svelte-supabase
You can try the Supabase Adder: https://github.com/supabase-community/svelte-supabase