-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Webpack compilation digest is written even if compilation fails #2648
Comments
I ran into the same issue recently. I can see how this makes sense when a compilation error is caused by the source files themselves (e.g. a syntax error) but there are other factors that contribute to the success of compilation. In our case, the sequence roughly went like this:
The issue becomes even more odd considering that the behavior of So in short:
Is there any desire to change this behavior to something that is more robust towards compilation failures that are not related to the source files? |
@clemens I agree. The digest needs to account for files like package.json, if it doesn't right. now. However, maybe a better approach to use timestamps? React on Rails has used that for years. If any file, such as package.json, has a newer timestamp than the manifest.json timestamp, then a rebuild is necessary. @clemens, @guillaumebriday any reason why timestamps on files would not work better? I'm pretty sure they would be much faster. |
@justin808 Sorry for the delayed response. Judging from the code you've linked, this would result in exactly the same issue: If compilation fails due to something that's related to the overall environment (not the content of files), then changing the environment to fix it without touching any files would not change the modification time (that's used by Happy to continue the discussion in a shakapacker ticket, if relevant. |
In PR 2117, we changed to write the compilation digest always even if webpack totally fails.
See: #2117 (comment)
I wrote:
This test seems incorrect to record that the compilation is fresh regardless of status
https://github.com/rails/webpacker/blob/master/test/compiler_test.rb#L47
The text was updated successfully, but these errors were encountered: