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

The requested module './../../../node-fetch/lib/index.js' does not provide an export named 'default' (at PostgrestBuilder.js:1:8) #518

Closed
2 tasks done
kjhughes opened this issue Feb 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kjhughes
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Adding a component that uses Supabase to Shoelace components produces the following error:

SyntaxError: The requested module './../../../node-fetch/lib/index.js' does not provide an export named 'default' (at PostgrestBuilder.js:1:8)

Which references this line in PostgrestBuild.js:

// @ts-ignore
import nodeFetch from '@supabase/node-fetch';

To Reproduce

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

  1. git clone https://github.com/shoelace-style/shoelace
  2. cd shoelace
  3. npm install @supabase/supabase-js
  4. npm install
  5. npm run build
  6. npm run test => All tests pass, check.
  7. Add Supabase to one of the components such as src/components/alert/alert.component.ts by adding the following two lines after the existing import statements:
import { createClient } from '@supabase/supabase-js'
createClient('https://xyzcompany.supabase.co', 'public-anon-key')
  1. npm run test
  2. Observe that now all tests fail to even load, each giving an error of the following form:
src/components/alert/alert.test.ts:

 🚧 Browser logs on Chromium:
      SyntaxError: The requested module './../../../node-fetch/lib/index.js' does not provide an export named 'default'
 🚧 Browser logs on Webkit:
      SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.

 ❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information. 

Expected behavior

Adding Supabase to a component should not cause its test and the tests of all other components in the package to fail to load.

System information

  • OS: macOS Sonoma 14.2.1
  • Browsers tested: chrome, safari
  • Version of supabase-js: 2.1.5
  • Version of Node.js: 21.5.0

Related report

This open issue appears to be related, but since it did not include a detailed means to reproduce, I thought I'd create a new issue to facilitate reproduction in hopes to resolve this more quickly:

@kjhughes kjhughes added the bug Something isn't working label Feb 14, 2024
@kjhughes
Copy link
Author

I've closed this issue and posted instead to supabase/supabase#21261 because is more pervasive as it prevents any Supabase functions from working as supabase-js cannot even load.

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

1 participant