supabase
supabase copied to clipboard
Update module to work with Nuxt 3.8.0
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
Might have been an issue with pnpm brought up when i upgraded to 3.8? built with bun and it went away... strange...
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
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.
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.
Thanks @madebyfabian, this solved my problem with
WARN Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'
What I did:
- Created an
.npmrc
-file in the root of my project - Added
shamefully-hoist=true
to it - 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
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'