Replies: 4 comments 1 reply
-
It is actual! We need separate configs tsconfig.json for the IDE, and another one is tsconfig.build.json to be used in real build. By the way, the only one way solve this problem temporarily is to disable type checking for production. typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
}, And optionally disable linting in package.json "build": "next build --no-lint", |
Beta Was this translation helpful? Give feedback.
-
You can simply rename the If you run the build script in the CI, you can run something like: script:
- yarn install
- mv tsconfig.build.json tsconfig.json
- yarn build |
Beta Was this translation helpful? Give feedback.
-
There's a typescript option the typescript: {
tsconfigPath: './tsconfig.wonky.json',
}, For example the above will look for |
Beta Was this translation helpful? Give feedback.
-
The above solution works for me. Using next v14.1.0. Thanks, @icyJoseph! |
Beta Was this translation helpful? Give feedback.
-
I have two config files for TypeScript. One is general
tsconfig.json
for the IDE, and another one istsconfig.build.json
to be used in real build. However, I don't know how to configure nextjs to use tsconfig.build.json file when it run on build.Is there way to set for it?
Beta Was this translation helpful? Give feedback.
All reactions