-
Notifications
You must be signed in to change notification settings - Fork 105
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
Export named 'default' is not provided #120
Comments
I have exactly the same problem since I updated my dependencies some days ago. What can we do to fix that? |
On the Nuxt3 Discord server someone game me the solution: In nuxt.config.ts build: {
transpile: ['@supabase', 'cross-fetch']
} But now I have this error #108. I think this lib is not compatible with Vite due to the deprecation of |
Temporary, I tried to use diff --git a/node_modules/cross-fetch/dist/browser-ponyfill.js b/node_modules/cross-fetch/dist/browser-ponyfill.js
index f26eb09..a89e834 100644
--- a/node_modules/cross-fetch/dist/browser-ponyfill.js
+++ b/node_modules/cross-fetch/dist/browser-ponyfill.js
@@ -545,10 +545,12 @@ delete __self__.fetch.polyfill;
// Choose between native implementation (global) or custom implementation (__self__)
// var ctx = global.fetch ? global : __self__;
var ctx = __self__; // this line disable service worker support temporarily
-exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
-exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.
-exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
-exports.Headers = ctx.Headers
-exports.Request = ctx.Request
-exports.Response = ctx.Response
-module.exports = exports
+// exports = ctx.fetch // To enable: import fetch from 'cross-fetch'
+// exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.
+// exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'
+// exports.Headers = ctx.Headers
+// exports.Request = ctx.Request
+// exports.Response = ctx.Response
+// module.exports = exports
+
+export default ctx
\ No newline at end of file In EDIT: @eMeRiKa13 Finally I used // ...
import { fetch } from 'ohmyfetch'
export default defineNuxtConfig({
// ...
supabase: {
supabaseUrl: process.env.SUPABASE_URL,
supabaseKey: process.env.SUPABASE_KEY,
supabaseOptions: { fetch }
}
)} The first usage example from |
Thank for your answer. At the end, I have just removed both transpile and it's now working For the Supabase integration, I'm using what Atinux, the Nuxt's creator, showcased here nuxt/framework#2058 |
Nice, thank you for that. I'll test it. @lquixada Sorry for the offtopic |
I've just discovered the same issue however this time with the Qwik framework. Any ideas on how to triage this?
|
I am running into this issue while using LitComponents. |
Hey.
I'm trying to use supabase (which uses
cross-fetch
) with Nuxt 3 and I found a problem withbrowser-ponyfill
:More info about ES modules in Nuxt 3: https://v3.nuxtjs.org/concepts/esm
The text was updated successfully, but these errors were encountered: