0

I just started trying to deploy to Vercel recently, and every time I push I have to check the errors during the build, only to find stringent typescript errors or other errors like "Can't use <img> tag, please use next/image" sorts of things. How can I get these errors during development so I don't have to wait til the build step only to find out after a few minutes there is an error, fix it, wait another few minutes, fix the next error, etc. How can I just get all these errors during development, like making it so my app won't compile locally somehow. Right now during development everything compiles fine, just when I push and it goes to Vercel build it starts throwing these errors.

How do I get the errors to display during development, and prevent compilation during npm run dev during development, instead of during npm run build? Also, I would like to be warned in my editor about possible errors in advance if possible, so I can fix them right there before facing them.

Lance
  • 75,200
  • 93
  • 289
  • 503
  • Firstly, this is not a TypeScript error. It is an ESLint error, [which can be easily disabled](https://stackoverflow.com/a/68173768/11613622). Secondly, you can run `next build` on your local setup to check for the build errors before hand. [Refer docs.](https://nextjs.org/docs/api-reference/cli#production) – brc-dd Jul 29 '21 at 06:29
  • That doesn't help, I want it to be run during `npm run dev` while it's watching files for changes. – Lance Jul 29 '21 at 07:37
  • Try adding `plugin:@next/next/recommended` to your existing ESLint config `extends` array. – juliomalves Jul 30 '21 at 22:07

1 Answers1

0
  1. To verify your application will build locally before pushing, you can run next build.
  2. To disable ESLint from failing your build, you can turn it off.
leerob
  • 2,876
  • 1
  • 18
  • 38