Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module to work with Nuxt 3.8.0 #298

Closed
CptJJ opened this issue Oct 24, 2023 · 10 comments
Closed

Update module to work with Nuxt 3.8.0 #298

CptJJ opened this issue Oct 24, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@CptJJ
Copy link

CptJJ commented Oct 24, 2023

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/@supabase+node-fetch@2.6.14/node_modules/@supabase/node-fetch/browser.js?v=0907fba1' does not provide an export named 'default' (at PostgrestBuilder.ts:2:8)

@danielroe

@CptJJ CptJJ added the bug Something isn't working label Oct 24, 2023
@CptJJ
Copy link
Author

CptJJ commented Oct 24, 2023

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

@jeremykung
Copy link

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

@richard-edwards
Copy link

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/@supabase+node-fetch@2.6.14/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.

@madebyfabian
Copy link

madebyfabian commented Apr 15, 2024

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.

@ollu
Copy link

ollu commented Apr 24, 2024

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

@mubaidr
Copy link

mubaidr commented Apr 30, 2024

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:  pnpm@9.0.6
- 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/content@2.12.1, @nuxt/eslint@0.3.10, @nuxt/fonts@0.6.1, @nuxt/image@1.6.0, @nuxt/ui@2.15.2, @nuxthq/studio@1.0.13, @nuxtjs/seo@2.0.0-rc.10, @nuxtjs/supabase@1.2.1,@pinia/nuxt@0.5.1, @unlok-co/nuxt-stripe@3.0.0, @vueuse/nuxt@10.9.0, nuxt-og-image@2.2.4, nuxt-security@1.4.3, @nuxtjs/i18n@8.3.1
- Build Modules:    -
------------------------------
bash
WARN  Failed to resolve dependency: @supabase/gotrue-js, present in 'optimizeDeps.include'

@maxiosigma
Copy link

vite: { ...oldCode, optimizeDeps: { include: ['@supabase/gotrue-js'] }, }

@danielroe
Copy link
Contributor

You might need to do something like @nuxtjs/supabase > @supabase/gotrue-js if this is a dependency of the module. Vite requires anything in optimizeDeps.include to be accessible within top-level node_modules which will be only true for pnpm users if they have installed it separately.

@mubaidr
Copy link

mubaidr commented Jun 17, 2024

Just to clarify, I am using pnpm, but installing @supabase/gotrue-js does not solve this issue.

@larbish
Copy link
Collaborator

larbish commented Jul 5, 2024

Might be fixed by the last release.

@larbish larbish closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants