-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
An attempt to use util ends in a painful circular dependency #18
An attempt to use util ends in a painful circular dependency #18
Comments
The automatic polyfill of |
Same blocking problem for me because of the usage of @apidevtools/swagger-parser module. |
Is there any movement / workaround for this? Im facing (i think) the exact same issue. @Mergasov , you mention:
Does this fix it? Ive tried to use the Cheers, |
The workaround might be to exclude polyfilling the |
Great, thanks - that seemed to fix it. Getting other issues now, but pretty sure unrelated to this specific issue. Thanks again, |
…` modules by default; rename `includeAliases` to `additionalAliases`, and allow ignoring the defaults with `onlyAliases` Fixes #40, #52, #18, #44 Signed-off-by: Richie Bendall <[email protected]>
…` modules by default; rename `includeAliases` to `additionalAliases`, and allow ignoring the defaults with `onlyAliases` Fixes #40, fixes #52, fixes #18, fixes #44 Signed-off-by: Richie Bendall <[email protected]>
* feat: add `fs` fallback * Update readme.md * Stop polyfilling `console`, 'domain', `process`, and internal `stream` modules by default; rename `includeAliases` to `additionalAliases`, and allow ignoring the defaults with `onlyAliases` Fixes #40, fixes #52, fixes #18, fixes #44 Signed-off-by: Richie Bendall <[email protected]> * Add as default Signed-off-by: Richie Bendall <[email protected]> * Update readme.md --------- Signed-off-by: Richie Bendall <[email protected]> Co-authored-by: Richie Bendall <[email protected]>
Bug report
What is the current behavior?
An external library my web app dependent on is, in turn, depends on Node.js util. This relationship inside a generated bundle results in the following graph with a circular dependency:
./node_modules/util/util.js -> node_modules/console-browserify/index.js -> ./node_modules/assert/build/assert.js -> ./node_modules/assert/build/internal/assert/assertion_error.js -> ./node_modules/util/util.js
The original
util
does not requestsconsole-browserify
, it was injected to there by the plugin in the following way:/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ "./node_modules/console-browserify/index.js");
This statement is placed to the very beginning of
./node_modules/util/util.js
code, soutil
manages to export nothing yet and whenasserion_error.js
trys to use its export stuff, I see this error:If the current behavior is a bug, please provide the steps to reproduce.
The resulting bundle will fail in both browser and Node.js environments.
What is the expected behavior?
The plugin would avoid this sort of situations. Probably, it would make sense to let a programmer to exclude modules where polyfilling should not be applied. (Of course, I know it is possible to exclude
console
package altogether, but I think it would not be convenient in the circumstances)Other relevant information:
webpack version:
5.45.1
node-polyfill-webpack-plugin version:
1.1.4
Node.js version:
14.15.2
Operating System:
Windows 10
The text was updated successfully, but these errors were encountered: