-
Notifications
You must be signed in to change notification settings - Fork 9
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
Change the webpack hook to use async tapPromises #9
Comments
Just to add a bit more info to this issue. This snippet of code below doesn't await for the download & unzipping. We've noticed it recently since our webpack builds have been failing unreliably due to a lack of remote typing. This issue is coming up very often now, perhaps because our zipped file is getting larger. compiler.hooks.afterPlugins.tap('WebpackRemoteTypesPlugin', () => {
return downloadFederationTypes(this.options.remotes, path_1.default.resolve(cwd, this.options.outputDir), this.options.remoteFileName);
}); The afterPlugins hook doesn't appear to be able to handle async https://webpack.js.org/api/compiler-hooks/#afterplugins. |
@ruanyl This PR fixed the webpack build process errors we were having. But the plugin no longer triggers when in development/using webpack devServer. Perhaps the It's not documented well, but I've tried quite a few hooks. I think we need to run the plugin on two hooks: "run" and "watchRun". Going to put a PR in now for a fix. |
@denis-heka Thanks for investigating this. I'm a bit concern that if people want the download to be triggered on every rebuild when running with |
@ruanyl Yep fair point, I'll decline my PR. Right now, myself and team need to build locally to get the types, which is a bit unintuitive. I can only think of one way to properly move forward with this:
Happy to have a crack at solving this if you think it is a decent solution? Also, I'm new to webpack plugins & loaders. How do you test both of these libraries? I've been editing them in node_modules until they work, there must be a better way? |
in my case most time I run projects with "start", in dev only, so I don't like do be forced to build before start. please take a look: #12 |
Hey, thanks for producing this plugin. I've noticed that there was an issue with the unzipping of the tar file not finishing before we tried to access the remote components, as such the imports were failing.
I can create a PR to use a different async webpack hook that appears to solve the issue. We want to change
compiler.hooks.afterPlugins.tap
tocompiler.hooks.beforeRun.tapPromise
What do you think?
The text was updated successfully, but these errors were encountered: