Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Checking Not Works with TypeScript 5.6+ and build: true Option #855

Open
kku39 opened this issue Feb 17, 2025 · 0 comments
Open

Type Checking Not Works with TypeScript 5.6+ and build: true Option #855

kku39 opened this issue Feb 17, 2025 · 0 comments
Labels

Comments

@kku39
Copy link

kku39 commented Feb 17, 2025

When I use [email protected] or 5.7 and set the fork-ts-checker-webpack-plugin's option typescript.build to true, the following problem occurs.

Current behavior

The webpack build completes with no errors even if there are type errors in source code such as:

const num: number = 'aaa'; // TS2322: Type 'string' is not assignable to type 'number'.

function foo(num: number) {}
foo('aaa'); // TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

Not sure if this is relevant, but I see the following messages during the build:

TypeError: The "path" argument must be of type string. Received undefined
TypeError: Cannot read properties of undefined (reading 'includes')

Expected behavior

The webpack build raises errors such as:

ERROR in ./index.ts:1:7
TS2322: Type 'string' is not assignable to type 'number'.
  > 1 | const num: number = 'aaa';
      |       ^^^
    2 |
    3 | function foo(num: number) {}
    4 | foo('aaa');

ERROR in ./index.ts:4:5
TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
    2 |
    3 | function foo(num: number) {}
  > 4 | foo('aaa');
      |     ^^^^^
    5 |

Steps to reproduce the issue

  1. Clone the repository described below.
  2. npm ci
  3. npx webpack

In addition, it works fine if you exec npm i [email protected] before the build.

Issue reproduction repository

https://github.com/kku39/issue-repro-of-fork-ts-checker-webpack-plugin

Environment

  • fork-ts-checker-webpack-plugin: 9.0.2
  • typescript: 5.7.3
  • eslint: None
  • webpack: 5.98.0
  • os: Windows 11, debian:11
@kku39 kku39 added the bug label Feb 17, 2025
@kku39 kku39 changed the title Type Checking Not Performed with TypeScript 5.6+ and build: true Option Type Checking Not Works with TypeScript 5.6+ and build: true Option Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant