-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Initialize buildDependencies after beforeLoaders Hook #14384
Initialize buildDependencies after beforeLoaders Hook #14384
Conversation
|
For maintainers only:
|
|
thank you @sokra! i will have a look there. |
262c245
to
9b1d35d
Compare
finally added the test case. let me know if you need any more changes from my side in order to get this merged :-) |
@swissmanu CI failed, can you fix it? |
9b1d35d
to
ab8e118
Compare
@alexander-akait thanks for the nudge. i fixed one part of the problem... but don't understand how to fix the other. the config test cases template is giving me the following error:
is there something in particular i am missing with my test case? i compared it with some others, but could not identify any significant differences imo :-/ |
ab8e118
to
88a9476
Compare
i was not aware that the actual test file containing the assertions is also required via webpack. my dummy plugin injected the loader for all files loaded; hence, also for the test file and with that, the actual assertions were overwritten by the loader 🙈 anyway: @alexander-akait @sokra should be all green now. ✅ |
@swissmanu can you fix tests on windows? |
88a9476
to
8e53818
Compare
@alexander-akait lesson learned: wait for the CI results before informing you guys 😇 sry for the buzz. everything looks good now, except that node-16 on linux could not install yarn: https://dev.azure.com/webpack/webpack/_build/results?buildId=14951&view=logs&jobId=fcdf401a-6636-533b-f723-8a3435a281c2 could anyone of you restart that particular job? |
@swissmanu The most important CI builds failed. This way your PR can't be merged. Please take a look at the CI results from azure (1 errors / 6 warnings) and appveyor (success) and fix these issues. |
All is fine, ignore random fails (when it happens for only one platform) 👍 |
Thanks |
What kind of change does this PR introduce?
buildDependencies
LazySet
inNormalModule
gets only initialized, if there is at least oneLoader
present for the module (https://github.com/webpack/webpack/blob/main/lib/NormalModule.js#L771-L773).beforeLoaders
hook is called after this conditional intialization (https://github.com/webpack/webpack/blob/main/lib/NormalModule.js#L776)buildDependencies
(https://github.com/webpack/webpack/blob/main/lib/NormalModule.js#L823-L825), one after another.beforeLoaders
hook adds a loader (e.g., in a plugin), the Lines 823-825 throw an error, sincethis.buildDependencies
was never initialized.buildDependencies
happens after thebeforeLoaders
hook was executed.Did you add tests for your changes?
🙋♂️ I read thetest/README.md
file and had a look at the existing test cases. Still, I require advice where I should put a test for my change. (I tend totest/cases/loaders
, but I am really not sure if this would be the right place. :) )Test case added to
test/configCases/loaders/pr-14384
Does this PR introduce a breaking change?
No.
What needs to be documented once your changes are merged?
Nothing.