Got an odd one here with Nextjs API lambda - endpo...
# help
c
Got an odd one here with Nextjs API lambda - endpoint keeps 503'ing with this error from CloudWatch (pic 1), if I look into the transpiled code I find this (pic 2) on the line it’s referencing which relates to the method in 3rd pic - is this some kind of bundling error? I’ve narrowed down the offending package to the import in my 4th pic. Have verified all env vars are included Initially I thought this was an issue with
fetch
needing to be polyfilled - but commenting out any fetch calls the issue remains, I have found https://answers.netlify.com/t/builds-started-to-fail-all-of-a-sudden/44183/16 which displays the same symptoms around serverless, auth0 and the
webpack_require
message… Really not sure where to go from here so help would be great, thanks
f
Hey @Cass Winfrey, which version of Next.js are you using?
c
Hey Frank, sorted it now, was due to a downstream dependency of auth0 (nodevm) using dynamic requires which I’m assuming doesn’t play nice with
esbuild
when bundling the lambdas
my solution was to just forgo using
auth0
completely and directly interact with their API using
fetch