supabase / auth-helpers

A collection of framework specific Auth utilities for working with Supabase.

Home Page:https://supabase.github.io/auth-helpers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install fails for Supabase Auth Helpers for SvelteKit

samhsabin opened this issue · comments

commented

I'm following the "Build a User Management App with SvelteKit" tutorial and getting npm install issues when trying to install the auth helpers for SvelteKit. It seems like there was a similar error about a year ago, with previous versions.

When I create a brand new SvelteKit project, install the Supabase client library, and then try to install the auth helpers for SvelteKit, I get the following npm install errors:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: supabase-sveltekit@0.0.1
npm ERR! Found: @sveltejs/kit@2.0.6
npm ERR! node_modules/@sveltejs/kit
npm ERR!   dev @sveltejs/kit@"^2.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @sveltejs/kit@"^1.15.4" from @supabase/auth-helpers-sveltekit@0.10.7
npm ERR! node_modules/@supabase/auth-helpers-sveltekit
npm ERR!   @supabase/auth-helpers-sveltekit@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I'm a bit frustrated and would love some help. Thanks for your time.

I'm running the current versions of supabase-js, node.js, and sveltekit:

macOS

  • Version of supabase-js: 2.39.1
  • Version of node.js: 21.5.0
  • Version of sveltekit: 2.0.6

As far as I can tell auth-helpers are being deprecated in favour for their new ssr package I imagine they have not updated the docs for frameworks yet. You can see a warning at the top of the documentation for auth helpers here and you can find more infomation on ssr here. On that same page they have info on how to do tasks with ssr.

Agreed. Supabase are sending confusing messages here

commented

Thanks for all the helpful information. I was under the assumption that the auth helpers were using SSR by default but apparently that is not the case. I'll have to look into the SSR options.

Part of the reason I swapped to Supabase from Appwrite is because of a lack of integrated SSR and broken tutorials, but unfortunately it seems that is the case for Supabase as well. Guess we'll have to see where things go forward. I can't imagine version compatibility with so many different platforms is an easy task, but as that's really the main value proposition of using a solution like Supabase, Appwrite, or Firebase, I hope things get fixed soon ❤️.

Sorry for the delay on this, I've merged the PR and released a new version (0.11.0) with support for the latest SvelteKit.

Sorry for the delay on this, I've merged the PR and released a new version (0.11.0) with support for the latest SvelteKit.

Weird, I'm getting this notice:

├─┬ @supabase/auth-helpers-sveltekit 0.10.7
│ └── ✕ unmet peer @sveltejs/kit@^1.15.4: found 2.4.3

@multiplehats looks like you aren't using the latest version (0.11.0) as the error you pasted mentions 0.10.7. You should upgrade to the latest version and try again.