supabase / auth-helpers

A collection of framework specific Auth utilities for working with Supabase.
https://supabase.github.io/auth-helpers/
MIT License
906 stars 237 forks source link

npm install fails for @supabase/auth-helpers-sveltekit #278

Closed secretgspot closed 2 years ago

secretgspot commented 2 years ago

Bug report

Describe the bug

unable to resolve dependency tree

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. come to any of the official sources such as npmjs.com, see that package was last updated few days ago and is at version 0.7.1 latest
  2. run "npm i @supabase/auth-helpers-sveltekit"
  3. watch screen fill with red

Expected behavior

stuff working as it should!

Screenshots

└ $ npm i @supabase/auth-helpers-sveltekit
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: muniapp@0.0.1
npm ERR! Found: @supabase/supabase-js@2.0.0-rc.10
npm ERR! node_modules/@supabase/supabase-js
npm ERR!   @supabase/supabase-js@"^2.0.0-rc.10" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @supabase/supabase-js@"^1.35.3" from @supabase/auth-helpers-sveltekit@0.7.1
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.
npm ERR!
npm ERR! See C:\Users\xxx\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Local\npm-cache\_logs\2022-10-02T00_53_00_263Z-debug-0.log

System information

    "devDependencies": {
        "@sveltejs/adapter-auto": "next",
        "@sveltejs/kit": "next",
        "svelte": "^3.46.0",
        "vite": "^3.1.0"
    },
    "type": "module",
    "dependencies": {
        "@fontsource/fira-mono": "^4.5.0",
        "@supabase/supabase-js": "^2.0.0-rc.10"
    }

Additional context

this is so frustrating, auth-helper not playing nice with older version of supabase-js so need to update supabase-js but then current auth-helper doesn't like latest version of supabase-js, which in turn doesn't like earlier version of auth-helper. I feel like developers don't even bother testing, checking, updating documentation and just do it for the sake of github heatmap being filled up

silentworks commented 2 years ago

From the looks of your system information, you are trying to install auth-helpers-sveltekit with the latest version v2 of the supabase-js library. We haven't released a version that works with that version as yet, the version released was to resolve issues with the breaking changes in SvelteKit RC. If you look at the peer dependency of the package.json you will notice its stated to work with ^1.35.3, so only versions in the v1 of the supabase-js library.

yzn-h commented 2 years ago

same here I'm trying to run any of the examples all of them don't work

david-plugge commented 2 years ago

same here I'm trying to run any of the examples all of them don't work

A bit more input on what exactly is not working or a reproduction would very handy

tomsharratt commented 2 years ago

Are there any plans to update this for v2 RC compatibility soon?

david-plugge commented 2 years ago

@tomsharratt I've been playing around a bit, you can take a look at my fork. It will probably change before the release but if you want to use it feel free. Also make sure to check if it's actually working correct, I didn't do a lot of testing.

To be concise the v2 rc update will take a bit more time to solidify the api and avoid breaking changes.

Edit:

the package is not published, you'd have to build it yourself.

yzn-h commented 2 years ago

same here I'm trying to run any of the examples all of them don't work

A bit more input on what exactly is not working or a reproduction would very handy

https://user-images.githubusercontent.com/63852512/193576367-64564a67-ed47-427d-a08e-cb6f65eaff54.mp4

reproduction: download the release 0.7.1 in the sveltekit example run pnpm i pnpm dev

david-plugge commented 2 years ago

same here I'm trying to run any of the examples all of them don't work

A bit more input on what exactly is not working or a reproduction would very handy

2022-10-03.15-25-26.mp4 reproduction: download the release 0.7.1 in the sveltekit example run pnpm i pnpm dev

Ahh i see. If you want to run any example inside the monorepo you need to build the packages first.

Run inside the monorepo root

pnpm i
pnpm build:sveltekit
pnpm dev --filter @example/sveltekit

If you want to run the example standalone you need to modify the package.json:

"dependencies": {
-   "@supabase/auth-helpers-sveltekit": "workspace:*",
+   "@supabase/auth-helpers-sveltekit": "^0.7.1",
}
Nisthar commented 2 years ago

@tomsharratt I've been playing around a bit, you can take a look at my fork. It will probably change before the release but if you want to use it feel free. Also make sure to check if it's actually working correct, I didn't do a lot of testing.

To be concise the v2 rc update will take a bit more time to solidify the api and avoid breaking changes.

Edit:

the package is not published, you'd have to build it yourself.

Can you tell me how do you use the build files in a sveltekit project?

david-plugge commented 2 years ago

@Nisthar copy the contents of this folder inside src/lib/supabase-auth. Adjust your src/app.d.ts and remove the app.d.ts file from the copied folder. That should be it. You can now import everything you need from $lib/supabase-auth.

Nisthar commented 2 years ago

@Nisthar copy the contents of this folder inside src/lib/supabase-auth. Adjust your src/app.d.ts and remove the app.d.ts file from the copied folder. That should be it. You can now import everything you need from $lib/supabase-auth.

image @david-plugge why is it not working?

can you publish it into npm?

enesbala5 commented 2 years ago

For me what worked was uninstalling the 2.0.3 version of supabase-js and installing 2.0.0

david-plugge commented 2 years ago

The auth helpers are released for v2 now so there shouldn´t be an issue anymore. l´ll close this issue now, feel free to open it again if you encounter any issues (or create a new issue)