nuxt-modules / supabase

Supabase module for Nuxt.
https://supabase.nuxtjs.org
MIT License
733 stars 129 forks source link

Latest version breaks Nuxt Devtools #385

Closed peoray closed 4 months ago

peoray commented 4 months ago

Version

@nuxtjs/supabase: v1.3.2 nuxt: v3.12.3

Reproduction Link

Steps to reproduce

What is Expected?

Nuxt Devtools should still be visible

What is actually happening?

The devtools is not rendered and not visible

jbjorge commented 4 months ago

Maybe relevant context - I get this in the browser console (did not start with a fresh project):

SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/@supabase+postgrest-js@1.15.8/node_modules/@supabase/postgrest-js/dist/cjs/index.js?v=469b7ed5' does not provide an export named 'default' (at wrapper.mjs:1:8)
peoray commented 4 months ago

@jbjorge thanks for the addition, I also got that same error

larbish commented 4 months ago

Are you sure you've updated to the 1.3.2? The '/_nuxt/node_modules/.pnpm/@supabase+postgrest-js@1.15.8/node_modules/@supabase/postgrest-js/dist/cjs/index.js?v=469b7ed5' does not provide an export named 'default' (at wrapper.mjs:1:8)error was part of the 1.3.1. My devtools is working as usual on my project with the latest version.

jbjorge commented 4 months ago

Looks to be 1.3.2 - and thanks for the quick follow up!

▶ pnpm why @nuxtjs/supabase
Legend: production dependency, optional only, dev only

devDependencies:
@nuxtjs/supabase 1.3.2
thanhtung167 commented 4 months ago

how to fix have same error sir

jbjorge commented 4 months ago

Could the change to optimizeDeps be to blame?

It both lists cookie and @supabase/postgrest-js, and none of them are found by vite.

 WARN  Failed to resolve dependency: cookie, present in 'optimizeDeps.include'
 WARN  Failed to resolve dependency: @supabase/postgrest-js, present in 'optimizeDeps.include'
larbish commented 4 months ago

Could you please provide a reproduction? I'll have a look. I'm not able to reproduce myself.

jbjorge commented 4 months ago

Reproduction repo here (I did not push .env file with SUPABASE_URL and SUPABASE_KEY, so those will need to be set)

Steps done to create the reproduction:

  1. pnpm dlx nuxi@latest init <project-name>
  2. pinned pnpm version to 9.5.0 in package.json (that thing was new to me, hope it doesn't cause trouble)
  3. npm run dev
  4. Verified that devtools work
  5. Installed supabase module through the devtools UI

Post module install

xMorthi commented 4 months ago

This could be related, my case is comming from intelisense Screenshot 2024-07-09 at 14 22 50

File '[...]/node_modules/.pnpm/@nuxtjs+supabase@1.3.2_magicast@0.3.4_rollup@4.18.1/node_modules/@nuxtjs/supabase/dist/runtime/server/services/index.d.ts' is not a module.ts(2306)
peoray commented 4 months ago

Are you sure you've updated to the 1.3.2? The '/_nuxt/node_modules/.pnpm/@supabase+postgrest-js@1.15.8/node_modules/@supabase/postgrest-js/dist/cjs/index.js?v=469b7ed5' does not provide an export named 'default' (at wrapper.mjs:1:8)error was part of the 1.3.1. My devtools is working as usual on my project with the latest version.

could also be related to the Nuxt version. What version are you using?

I'm using the latest Nuxt version

jbjorge commented 4 months ago

I think I've pinned it down to being a pnpm issue and not an issue with the supabase-module. My reproduction repo works fine with npm. Don't know if this is something that should be fixed by the supabase module or if we should add some config in pnpm.

peoray commented 4 months ago

I think I've pinned it down to being a pnpm issue and not an issue with the supabase-module. My reproduction repo works fine with npm. Don't know if this is something that should be fixed by the supabase module or if we should add some config in pnpm.

does installing as a dependency or devdependency make any difference when using pnpm?

larbish commented 4 months ago

Should be fixed in 1.3.4

larbish commented 4 months ago

does installing as a dependency or devdependency make any difference when using pnpm?

It does not change anything with Nuxt.

peoray commented 4 months ago

Should be fixed in 1.3.4

awesome, thanks.

for some weird reason, it also breaks shadcn-vue as well (pnpm)

CyberSekure commented 4 months ago

Thanks for this, was scratching my head yesterday and just noticed this issue (I had the same). Fixed it for me!