-
Notifications
You must be signed in to change notification settings - Fork 12k
[@ngtools/webpack] Decoration of compiler.inputFileSystem breaks its API #10064
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
Comments
I believe the With this in mind, there is no guarantee that it should exist in the Decorating I think |
Like @filipesilva said, |
I'm not sure if using another decoration here makes sense or is useful - it would end up with a decoration of an already decorated However, I agree that relying on a private method isn't the best idea, and will open a corresponding issue on the |
It's also important to note that the webpack filesystem abstractions are intended to be extendable and/or re-implementable. Webpack provides NodeJS versions which are used by default. These specifically have the following:
The plugin in question here appears to be assuming that webpack is using, and providing via |
Suppose I can close this - the corresponding issue on the other repo has been closed due to a fix being merged recently. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I've recently attempted to update one of my projects to
webpack
v4, in addition to a couple of other updates. One of them broke my build with a curious error:After debugging things a bit, I figured out that one of the plugins I'm using attempts to access
compiler.inputFileSystem._readFile
, which is present in theapply
phase, but was no longer existing when it came toemit
.Playing a bit with the configuration, I was able to point out that this modification was made by the
AngularCompilerPlugin
, which is part of@ngtools/webpack
. More precisely, it happens due to thedecoration
performed by it:angular-cli/packages/@ngtools/webpack/src/angular_compiler_plugin.ts
Lines 549 to 553 in d1b22d0
After this,
compiler.inputFileSystem._readFile
is no longer available. Thus, the decoration breaks the API available oncompiler.inputFIleSystem
and makes plugins relying on it fail.Versions
ng
version, since it's a custom setupRepro steps
yarn
yarn build
Observed behavior
The last command will fail with an error like this.
(See the build output here: https://travis-ci.org/DorianGrey/ng-webpack-template/jobs/357274315)
Desired behavior
Decoration or encapsulation of any of these internal parts of
webpack
should not break their available API, regardless of potentially intended privacy (suppose the leading_
might tend in this direction).Mention any other details that might be useful (optional)
I've also tried the latest beta version of the
@ngtools/webpack
plugin and made a cross-check againstwebpack
v3, but neither made any difference.Not sure if this is of any help or use, but the affected plugin in my case is the
workbox-webpack-plugin
, which changed it's implementation and behavior in v3.https://github.com/GoogleChrome/workbox/blob/fa4d8b7dab2b0680c15d6057c12fd9ec9f0932c4/packages/workbox-webpack-plugin/src/inject-manifest.js#L150-L154
Suppose that's why this problem did not raise before.
The text was updated successfully, but these errors were encountered: