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

Excluded files trigger plugin a new incremental check. #558

Closed
Melzmr opened this issue Jan 6, 2021 · 11 comments · Fixed by #624
Closed

Excluded files trigger plugin a new incremental check. #558

Melzmr opened this issue Jan 6, 2021 · 11 comments · Fixed by #624
Labels

Comments

@Melzmr
Copy link

Melzmr commented Jan 6, 2021

Current behavior

Excluded files trigger plugin a new incremental check.

Expected behavior

Excluded files must not trigger another incremental check.

Steps to reproduce the issue

I have the following webpack config parts:

  1. ts-loader
 {
  test: /\.tsx?$/,
  exclude: /node_modules/,
  loader: 'ts-loader',
  options: {
    transpileOnly: true,
    configFile: tsConfigPath,
  }
}
  1. fork-ts-checker-webpack-plugin
new ForkTsCheckerWebpackPlugin({
  async: inDev,
  typescript: {
    configFile: tsConfigPath,
  },
  logger: { infrastructure: 'console' },
})
  1. TS config excludes dist folder
{
  ...
  "exclude": ["node_modules", "dist"]
}

✅ In version 5.2.1 I have the following results after I change a single character in a component in a watch mode:

Calling reporter service for incremental check.
Changed files: ["/Users/user1/Desktop/test/testWeb/src/client/pages/Home.tsx"]
Deleted files: []
Hash: 6bd4c7ad42193b7547ca
Version: webpack 4.44.2
Time: 1937ms
Built at: 01/07/2021 1:21:18 AM
Asset      Size  Chunks             Chunk Names
js/server.js  21.3 MiB    main  [emitted]  main
Entrypoint main = js/server.js
[./src/client/pages/Home.tsx] 1.68 KiB {main} [built]
    + 1275 hidden modules
No issues found.
Time: 1992 ms

❌ With the same configs in version 6.0.8 I have the following results after I change a single character in a component in a watch mode:

Calling reporter service for incremental check.
Changed files: ["/Users/user1/Desktop/test/testWeb/src/client/pages/Home.tsx"]
Deleted files: []
Hash: 3ef157e40a413d3102d7
Version: webpack 4.44.2
Time: 1569ms
Built at: 01/07/2021 1:33:19 AM
 Asset      Size  Chunks             Chunk Names
js/server.js  21.3 MiB    main  [emitted]  main
Entrypoint main = js/server.js
[./src/client/pages/Home.tsx] 1.69 KiB {main} [built]
    + 1275 hidden modules
Issues checking in progress...
No issues found.
Time: 1715 ms
Calling reporter service for incremental check.
Changed files: ["/Users/user1/Desktop/test/testWeb/dist/js/main-ffe2403fd22bca30c789.js"]
Deleted files: []
No issues found.
Time: 168 ms

😢 For some reasons generated files from dist folder start to trigger another checks.

Issue reproduction repository

Let me know if reproduction example is surely needed.

Environment

  • fork-ts-checker-webpack-plugin: 6.0.8
  • typescript: 4.1.3
  • eslint: 7.17.0
  • webpack: 4.44.2
  • os: macOS 10.15.7

P.S. Let me know if this question should be asked somewhere else and not in github issues and sorry 😅

@Melzmr Melzmr added the bug label Jan 6, 2021
@piotr-oles
Copy link
Collaborator

Hi! Thanks for reporting this issue. Please create a reproduction repository :)

@jimisaacs
Copy link

jimisaacs commented Feb 17, 2021

I can confirm the same issue, as well as additional context. This plugin now reports on unreachable code when as before it didn't when option "allowUnreachableCode" is enabled.

Also the plugin option "typescript.configOverwrite" does not actually work to exclude files. Either with "exclude" or "include".

The only way that actually works with version 6 of the plugin to exclude is issue filtering, or downgrading back to version 5 of the plugin.

@grumd
Copy link

grumd commented Mar 23, 2021

Can confirm, "excludes" in tsconfig is getting ignored now. Code that was excluded and didn't throw any errors in 5.x will throw errors in 6.x with the same configs.

@piotr-oles
Copy link
Collaborator

As I said, please create a reproduction repository, so I can help. I have limited resources that I can spend working on this package, so I have to delegate the reproduction step to the community, sorry :)

@piotr-oles piotr-oles added the watch Related to file system watch label Apr 21, 2021
@grumd
Copy link

grumd commented Apr 23, 2021

@piotr-oles I've already made a reproduction repository here: #580

I guess this issue could be closed as a duplicate?

@piotr-oles
Copy link
Collaborator

@grumd No, your issue is not related to this one :)

@Melzmr
Copy link
Author

Melzmr commented May 2, 2021

@piotr-oles Hello again!)

I've decided to give webpack 5 another try and everything is good except this particular issue with incremental checks :(

Since it's the only problem that stops me from using webpack 5 Actually, I just downgraded fork-ts-checker-webpack-plugin to 5.2.1 and everything seems to work fine. I've found some time to create a minimal reproduction example.

Reproduction repository

I will be very glad if you find some time and look into this issue. Let me know if I need to change something in the repository.

Thanks!

@piotr-oles
Copy link
Collaborator

piotr-oles commented Jun 18, 2021

@Melzmr Thanks for the reproduction repository, I found the issue and fixed it in #624 :)

@Melzmr
Copy link
Author

Melzmr commented Jun 18, 2021

@Melzmr Thanks for the reproduction repository, I found the issue and fixed it in #624 :)

Great! I am glad that it helped 🎉

I will give it a try in a while. Thanks

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 6.2.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 7.0.0-alpha.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants