TypeStrong / fork-ts-checker-webpack-plugin

Webpack plugin that runs typescript type checker on a separate process.
MIT License
1.93k stars 238 forks source link

error in Project References when add new file #798

Open holynewbie opened 1 year ago

holynewbie commented 1 year ago

Current behavior

when "composite": true is in tsconfig.json ,add a new file and quote it in somewhere, it issue an error

image

Expected behavior

don't issue an error

Steps to reproduce the issue

package.json

{
  "name": "webpack-demo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "webpack serve"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "fork-ts-checker-webpack-plugin": "^7.3.0",
    "ts-loader": "^9.4.2",
    "typescript": "^4.9.5",
    "webpack": "^5.75.0",
    "webpack-cli": "^5.0.1",
    "webpack-dev-server": "^4.11.1"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "composite": true,
    "target": "es2016",
    "module": "commonjs",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
  }
}

webpack.config.js

const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = {
    mode: 'development',
    context: __dirname,
    entry: './src/index.ts',
    resolve: {
        extensions: [".ts", ".tsx", ".js"],
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
            }
        ]
    },
    plugins: [new ForkTsCheckerWebpackPlugin()],
    watchOptions: {
        ignored: /node_modules/,
    },
};

start the app!, and add a new file, quote it in somewhere.

https://user-images.githubusercontent.com/8347286/219620910-70d06703-fc6f-4b58-b7e7-607aa81281a7.mp4

Issue reproduction repository

Environment

piotr-oles commented 1 year ago

Thanks for the report - it looks like this issue appears only with newer versions on TypeScript. I can't promise I will take a look at this soon but it's on my radar.