website icon indicating copy to clipboard operation
website copied to clipboard

Update vercel.md

Open mkv27 opened this issue 1 year ago • 4 comments

Isn't this mandatory to avoid this issue when using with NextJS?

mkv27 avatar Dec 13 '23 10:12 mkv27

Hi @mkv27

Isn't this mandatory to avoid this issue when using with NextJS?

No. To avoid the issue, you have to add NODEJS_HELPERS=0 to your project.

yusukebe avatar Dec 13 '23 18:12 yusukebe

Hello! But what if you need those helpers in other parts of your project?

mkv27 avatar Dec 13 '23 18:12 mkv27

Maybe we have only this way: https://vercel.com/docs/functions/serverless-functions/runtimes/node-js#disabling-helpers-for-node.js

yusukebe avatar Dec 13 '23 19:12 yusukebe

I just noted there is a similar issue with two different sources, I mean the issue is the same "500 error when the method is not GET or HEAD".

  • When you have a node project with the api folder and would like to deploy it in Vercel you'll need the NODEJS_HELPERS=0
  • When you have a NextJS project and would like to deploy it in Vercel you just need:
export const config = {
	api: {
		bodyParser: false,
	},
}

mkv27 avatar Dec 13 '23 20:12 mkv27