4

If I have a typescript error, I can see it in my editor but not in the browser, nor in the terminal running npm run dev. It does show when running npm run build.

Is there any way to make type errors apparent during npm run dev in the terminal and the browser window?

0

1 Answer 1

0

As I know currently there is no easy way to enable checking during development https://github.com/vercel/next.js/issues/12735#issuecomment-626869676. It was done on purpose to speed up the development.

Maybe it would be helpful to know that you can disable those errors for the build. Add this to your next.config.js

module.exports = {
  typescript: {
    ignoreBuildErrors: true
  }
};

See here for the documentation of ignoreBuildErrors.

Sign up to request clarification or add additional context in comments.

1 Comment

I think that you should not ignore build errors for production build as this masks the actual error and may lead to unnoticed bugs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.