API routes runtime errors when deployed via Vercel CLI (monorepo setup)
Unanswered
Turkish Angora posted this in #help-forum
Turkish AngoraOP
Hello!
Switched from Vercel integration to GitHub Actions following this [guide](https://vercel.com/guides/how-can-i-use-github-actions-with-vercel) and now trying to deploy a single small Next.js project (next/og) within a monorepo setup (
1)
2)
The first error has gone after I had added '@swc/helpers' to dependencies (the fix looks weird though), but for the second one it just doesn't work like that (with '@next/env').
Similar discussion on GH - https://github.com/orgs/vercel/discussions/2285.
Would really appreciate any help!
Switched from Vercel integration to GitHub Actions following this [guide](https://vercel.com/guides/how-can-i-use-github-actions-with-vercel) and now trying to deploy a single small Next.js project (next/og) within a monorepo setup (
vercel build
, vercel --prebuilt --force
in a specific dir). The build passes just fine, but I'm getting runtime errors on API routes:1)
Cannot find module '@swc/helpers/_/_interop_require_default'
Require stack:
- /var/task/node_modules/next/dist/client/components/react-dev-overlay/server/middleware.js
- /var/task/node_modules/next/dist/server/patch-error-inspect.js
- /var/task/node_modules/next/dist/server/node-environment-extensions/error-inspect.js
- /var/task/node_modules/next/dist/server/node-environment.js
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.cjs
Did you forget to add it to "dependencies" in `package.json`?
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
2)
Cannot find module '@next/env'
Require stack:
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.cjs
Did you forget to add it to "dependencies" in `package.json`?
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
The first error has gone after I had added '@swc/helpers' to dependencies (the fix looks weird though), but for the second one it just doesn't work like that (with '@next/env').
Similar discussion on GH - https://github.com/orgs/vercel/discussions/2285.
Would really appreciate any help!