question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supabase works with Vite but not SvelteKit dev mode

See original GitHub issue

Describe the bug

Importing Supabases’s client and refreshing the page shows an error that always looks something like…

500
ENOENT: no such file or directory, open '[project_folder]/node_modules/@supabase/supabase-js/src/index.ts'

Error: ENOENT: no such file or directory, open '[project_folder]/node_modules/@supabase/supabase-js/src/index.ts'

Building and running (npm run build npm run start) works fine, and the client can be used.

Have tested with a normal Vite Svelte app (npm init @vitejs/app) and that works fine.

To Reproduce

npm init svelte@next
npm install
npm install --save @supabase/supabase-js
// index.svelte
import { createClient } from '@supabase/supabase-js'

Reproducible repo

Information about your SvelteKit Installation:

npx: installed 1 in 1.117s

  System:
    OS: macOS 11.2.3
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 939.37 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.4 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.10 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Safari: 14.0.3
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.59 
    svelte: ^3.29.0 => 3.35.0

Chrome

static

Severity

I’m probably doing something stupid here, so sorry if this is a waste of your time. But we want to build a simple-ish web app using SvelteKit and Supabase and this is stopping us.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
benmccanncommented, Mar 29, 2021

Does it work if you install it as a devDependency? https://github.com/supabase/supabase-js/issues/89#issuecomment-809385143

0reactions
ixxiecommented, Apr 14, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

SvelteKit with Supabase SSR Auth Helpers
This is a localhost address where SvelteKit serves the project in development mode. This change was introduced with Vite 3. Go to Settings...
Read more >
Quickstart: SvelteKit - Supabase
This example provides the steps to build a basic user management app. It includes: Supabase Database: a Postgres database for storing your user...
Read more >
Sveltekit,Supabase and Vercel (problem with ... - Stack Overflow
I'm trying to set up Sveltekit, Supabase and Vercel. It works correctly on a local environment (SvelteKit and Supabase), but when I deploy ......
Read more >
Introduction • Docs • SvelteKit
SvelteKit is a framework for rapid development of robust, performant web applications. ... It uses Vite with a Svelte plugin to provide a...
Read more >
Deploy a Svelte site · Cloudflare Pages docs
It defaults to the GitHub repository's name, but it does not need to ... directory to .svelte-kit/cloudflare , local development has a few ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found