This works well in development, but in production Im receiving a 504 error with Vercel logs showing:
11:14:17 AM: Reconnecting to MongoDB for api/subscription
TypeError: fetchImpl is not a function
at wrappedFetch (/var/task/___vc/__launcher.js:133:16)
at u (file:///var/task/node_modules/lemonsqueezy.ts/dist/modules/subscription.mjs:1:437)
at R (file:///var/task/node_modules/lemonsqueezy.ts/dist/modules/subscription.mjs:1:1178)
at GET (/var/task/.next/server/pages/api/subscription.js:893:123)
at handler (/var/task/.next/server/pages/api/subscription.js:917:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Ive also tried this with
const client = new LemonSqueezyClient(process.env.LEMON_API_KEY);
const subscriptions = await client.listAllSubscriptions()
but Im receiving the same error. Do you have any idea where I might be going wrong with this?
I am trying to implement a NextJS API route to identify a single subscription by user email. So far the route looks like this:
This works well in development, but in production Im receiving a 504 error with Vercel logs showing:
Ive also tried this with
but Im receiving the same error. Do you have any idea where I might be going wrong with this?
Thanks!