-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add webpack plugin to check for duplicate npm packages #8475
Comments
Note, it looks like the plugin might need some tweaks when using pnpm to install dependencies. |
If the Vaadin version is 16+ (flow 3.1+) the server is still started due to the parallel frontend build to the server startup. It would be more straight forward to get this to 14 as it doesn't have the parallel build (yet) but it we should still fix this so that the duplicate error message is also visible in a meaningful way in the browser. Not sure if we can terminate the server run time nicely if the webpack build fails. The easiest thing would be to include this now to the V14 version starters. |
It seems like the ^ plugin is not getting pnpm support any time soon, but if pnpm works properly (mentioned recent regressions causing duplicates) and #8446 is done we would not need this plugin at all for pnpm. |
Submitted an example PR to Bakery |
BTW, there is a new script in platform build that checks that we do not deliver a release with the problem described here. vaadin/platform#1364 |
I know about the platform build, but the problem might still happen in following cases:
|
I've got the same after upgrading a vaadin project 14.1 to 14.3.0.alpha1. With this configuration I've got the explanation: So 👍 for this tool. (I don't know how to solve it but I know that the error comes from multiselect-combo-box). |
If you are using Otherwise the only thing we can do is to ask |
I've opened an issue for the add-on. PNPM fixed this issue. Thanks for the suggestion. |
@jcgueriaud1 which issue do you talk about? |
@Djaler This issue: gatanaso/multiselect-combo-box-flow#59 Thanks to the current ticket, I've got more explanation about the DuplicatePackage error (a conflict between vaadin-combobox and the third party multiselect combobox). Then I tried to change from npm to pnpm and the duplicate error was managed by pnpm. |
Because of #7472 I can't see the webpack error message at all, therefore I have no idea what's going wrong or which package is duplicate. It's better if I remove DuplicatePackageCheckerPlugin since at least I'll get a more informative error message at runtime! |
Problem
As a developer, I want to fail the build on
webpack
stage if the bundle contains duplicate web components that would crash my app in runtime, see vaadin/vaadin-rich-text-editor-flow#99Proposed solution
Use https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin
Currently it is possible with the following custom config:
Example output
Acceptance criteria
When webpack build fails on duplicate versions, the process terminates. Currently, with custom config shown above, the server still starts like nothing happened 🤷♂️
The text was updated successfully, but these errors were encountered: