supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Update module to work with Nuxt 3.8.0

Open CptJJ opened this issue 8 months ago • 3 comments

Nuxt 3.8 warns about possible broken modules: "You may also encounter modules in the Nuxt ecosystem that need to be updated; please open an issue for those modules. I'm also very happy to help if you're encountering any problems with this, if you're a module author. Just tag me and I'll take a look."

I get this when launching the dev server:

Failed to resolve dependency: @supabase/functions-js, present in 'optimizeDeps.include'                                                   11:43:02 AM
 WARN  Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'                                                      11:43:02 AM
 WARN  Failed to resolve dependency: @supabase/postgrest-js, present in 'optimizeDeps.include'                                                   11:43:02 AM
 WARN  Failed to resolve dependency: @supabase/realtime-js, present in 'optimizeDeps.include'                                                    11:43:02 AM
 WARN  Failed to resolve dependency: @supabase/storage-js, present in 'optimizeDeps.include'                                                     11:43:02 AM
 WARN  Failed to resolve dependency: @supabase/supabase-js, present in 'optimizeDeps.include'   

and then get the error:

Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/@[email protected]/node_modules/@supabase/node-fetch/browser.js?v=0907fba1' does not provide an export named 'default' (at PostgrestBuilder.ts:2:8)

@danielroe

CptJJ avatar Oct 24 '23 18:10 CptJJ

Might have been an issue with pnpm brought up when i upgraded to 3.8? built with bun and it went away... strange...

CptJJ avatar Oct 24 '23 19:10 CptJJ

I'm also getting an issue that seems to come from the Supabase Module. I'm using Nuxt 3.8 with Node.js runtime. Cannot find module './lib/websocket' Require stack: - ~\nuxt-app\websocket

jeremykung avatar Oct 26 '23 14:10 jeremykung

I'm having a similar issue with Nuxt 3.8 and also back ported to 3.7 and same error. Did a full package clean and restore.

PostgrestBuilder.ts:2 Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/@[email protected]/node_modules/@supabase/node-fetch/browser.js?v=a82b1307' does not provide an export named 'default' (at PostgrestBuilder.ts:2:8)

I'm getting no errors in the dev server, just the one above in the browser console.

richard-edwards avatar Nov 01 '23 17:11 richard-edwards

Have the same error when using pnpm, nuxt@^3.11.2 and @nuxtjs/supabase@^1.2.0. Setting shamefully-hoist=true in .npmrc solves this though.

madebyfabian avatar Apr 15 '24 11:04 madebyfabian

Thanks @madebyfabian, this solved my problem with

WARN Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'

What I did:

  1. Created an .npmrc-file in the root of my project
  2. Added shamefully-hoist=true to it
  3. Saved the file and ran npm run dev again Voilá, no more warning!

The content of my .npmrc-file:

# https://pnpm.io/npmrc#shamefully-hoist
# Fixes: WARN Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'
shamefully-hoist=true

Not clear to me why this worked with npm since it seems to me to be an pnpm-setting 🤷 Read more about the setting here https://pnpm.io/npmrc#shamefully-hoist

ollu avatar Apr 24 '24 07:04 ollu

I have same npm config, but this warning still exists in latest nuxt version.

------------------------------
- Operating System: Linux
- Node Version:     v20.11.1
- Nuxt Version:     3.11.2
- CLI Version:      3.11.1
- Nitro Version:    2.9.6
- Package Manager:  [email protected]
- Builder:          -
- User Config:      colorMode, css, devtools, experimental, extends, eslint, fonts, hooks, i18n, image, imports, modules, nitro, pinia, router, routeRules, runtimeConfig, security, seo, ssr, studio, supabase, telemetry, typescript, ui, features
- Runtime Modules:  @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxt/[email protected], @nuxthq/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected],@pinia/[email protected], @unlok-co/[email protected], @vueuse/[email protected], [email protected], [email protected], @nuxtjs/[email protected]
- Build Modules:    -
------------------------------

bash
WARN  Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'

mubaidr avatar Apr 30 '24 10:04 mubaidr