Open LarchLiu opened 1 year ago
Same error with: Nuxt Supabase
Could that be related to supabase compatibility with workerd ? Ie you'd need to pass the correct fetch function to the supabase client https://github.com/supabase/supabase-js
import { createClient } from '@supabase/supabase-js'
// Provide a custom `fetch` implementation as an option
const supabase = createClient('https://xyzcompany.supabase.co/', 'public-anon-key', {
global: {
fetch: (...args) => fetch(...args),
},
})
Could that be related to supabase compatibility with workerd ? Ie you'd need to pass the correct fetch function to the supabase client https://github.com/supabase/supabase-js
import { createClient } from '@supabase/supabase-js' // Provide a custom `fetch` implementation as an option const supabase = createClient('https://xyzcompany.supabase.co/', 'public-anon-key', { global: { fetch: (...args) => fetch(...args), }, })
Ran into the same issue, as soon as i removed
nitro: { preset: 'vercel-edge', },
From nuxt.config.ts the build ran fine, so I don't think it has to do with nuxt supabase?
same here, edge functions just does not work with nitro:
TypeError: Cannot read properties of undefined (reading 'fd')
at (index.mjs:1:177034)
at (index.mjs:1:170819)
at (index.mjs:1:198941)
at (index.mjs:1:199950)
at (__nitro:middleware.js:1:17)
It works with serverless functions but i would like to use edge functions
Environment
node: v18.15.0 nitro: 2.4.1 nitro.config.ts:
package.json
vercel.json
Reproduction
repo Deploy on Vercel and access
/api/test
.error link
Describe the bug
I use the
vercel-edge
preset to build a nitro app, there are two api routes/api/test
and/api/card
. If i add some code to/api/card
, all edge functions will crash. However, if i use thenetlify-edge
, it works well.https://github.com/LarchLiu/nitro-starter/blob/f7aaa176b6f0e97219873af44cfd5023ffd4e295/routes/api/card.ts#L9
Additional context
No response
Logs