-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
tsLoaderDefinitionFileVersions is changing between builds #1048
Comments
Thanks for taking the time to raise this. I've read and re-read this but I'm afraid I'm not sure what the issue you're encountering is or what Also, if you'd like to work on this then please do have a go; I can try and advise as you do perhaps. |
@johnnyreilly Thanks. I would like also to understand better why this happens, and help to fix it if possible, I would really appreciate some hint, what could be the culprit? any guess? As I understand Line 488 in e9ef049
It can be reproduced as this:
When they do not match, the "hash" created is different, for example:
|
Gosh I haven't looked at that code for a long time and I can't remember too much about it! I'd advise debugging and seeing how the values can change. Is it just ordering? Or is it a different number of entries as well? Start answering those questions and maybe that will lead to some potential solutions |
@johnnyreilly I found that this is related somehow to the order of the entries, for example having webpack.config.js: ...
// sometimes foo is compiled first, otherwise it is bar and the hash will change
entry: {
trial: [path.resolve('src/foo.ts'), path.resolve('src/bar.ts')],
},
// changing to use an index file that just re-export the all from the other 2, will not fail
entry: {
trial: [path.resolve('src/index.ts')],
}, Also it works fine, if I "force" to have a fresh instance by commenting the Line 49 in 37a0731
|
Interesting. Can the Or can the order of |
I tried, it is a bit better but not a full solution, because there is different number of entries when the failure happens also. :( |
How about |
Line 49 in 37a0731
This instance is called and re-used to compile each file, somehow this is affecting the result when the files are compiled in different order (foo/bar or bar/foo). The problem happens only when using webpack.config.js
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
Expected Behaviour
tsLoaderDefinitionFileVersions should be deterministic and output always the same source.
Actual Behaviour
tsLoaderDefinitionFileVersions is changing between builds (without any source code change), producing that webpack's hashing to get invalidated.
Steps to Reproduce the Problem
Please see discussion on webpack issue and findings: webpack/webpack#8419 (comment)
Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/artola/webpack-bug
Running a few times the same build it will produce different file hashes due changes in
tsLoaderDefinitionFileVersions
.The repo contains a demo with 2 files (foo.ts and bar.ts) and what I can see is that they are "sometimes" processed in different order ("foo then bar" most of times, until happens "bar then foo") producing the mentioned problem.
The text was updated successfully, but these errors were encountered: