简体   繁体   中英

How to disable typescript for failing my builds with nextjs?

Getting a bunch of type errors upon running yarn next build<\/code> , for example:

Is there a command i can put in my tsconfig to prevent this from happening?

From NextJS docs: https://nextjs.org/docs/api-reference/next.config.js/ignoring-typescript-errors

Just put this lines in next.config.js under the typescript section:

 module.exports = { typescript: { // !! WARN !! // Dangerously allow production builds to successfully complete even if // your project has type errors. // !! WARN !! ignoreBuildErrors: true, }, }

just put

// @ts-ignore 

in the line you want to disable type checking

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM