Function on Vercel throws error

I am new to RedwoodJS and impressed. In the last days I was playing around and tried to deploy to AWS where I was successful for the API, but did not manage to connect the web part on S3 with my lambda. Therefore I decided to try out Vercel and Netlify.

:x: Vercel
First I tried to deploy it to Vercel.

Opening a page in my app that calls the function throws an error. In the Vercel dashboard I can see the following invocation error when navigating to a page, e.g. https://vemidi.vercel.app/flats

2021-06-04T09:27:03.541Z fb389a50-f0ed-4bfd-8e1e-901c4f8191e6 ERROR Invoke Error {"errorType":"Error","errorMessage":"Cannot find module '/var/task/node_modules/@babel/runtime-corejs3/core-js/json/stringify.js'","code":"MODULE_NOT_FOUND","path":"/var/task/node_modules/@babel/runtime-corejs3/package.json","stack":["Error: Cannot find module '/var/task/node_modules/@babel/runtime-corejs3/core-js/json/stringify.js'"," at createEsmNotFoundErr (internal/modules/cjs/loader.js:912:15)"," at finalizeEsmResolution (internal/modules/cjs/loader.js:905:15)"," at resolveExports (internal/modules/cjs/loader.js:437:14)"," at Function.Module._findPath (internal/modules/cjs/loader.js:477:31)"," at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)"," at Function.Module._load (internal/modules/cjs/loader.js:730:27)"," at Module.require (internal/modules/cjs/loader.js:957:19)"," at require (internal/modules/cjs/helpers.js:88:18)"," at Object.<anonymous> (/var/task/node_modules/@redwoodjs/api/dist/logger/index.js:15:41)"," at Module._compile (internal/modules/cjs/loader.js:1068:30)"]}

:tada: Netlify
Next I tried to deploy to Netlify. That worked like charm.

So it seems there is a problem with Deploy to Vercel. I am happy to help digging deeper to get this solved.

I am using version Redwood version 0.33.0.

Hey @tilmannb I think I came across this in my vercel deployment too. I believe its to do with the logger and vercel’s build process.

I’ve created an issue: Vercel deployments fail when using @redwoodjs/logger · Issue #2736 · redwoodjs/redwood · GitHub to track this, and will be discussing with vercel team.

Hi @danny,

thanks for the fast reply. If there is anything I can help with let me know.

Hey @tilmannb just confirming that this issue has now been resolved on the vercel side. `@redwoodjs/api` failing to include `@babel/runtime-corejs3` · Issue #220 · vercel/nft · GitHub

We’re good to go on deployments to vercel, you’ll just need to redeploy your branch.

Let us know if its working for you, I checked on one of our apps, and seems to be working fine :zap:

Hi @danny,
thanks for sorting it out so quickly. I can confirm: It is working. :rocket:

2 Likes