-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Description of the bug
The issue concerns multi-module repositories using npm monorepo and hoisted dependencies installation. Consider the directory structure:
package.json
— main filenode_modules/
— common npm dependenciespackages/ts/my-component/
— frontend component using Vaadin web component dependenciespackages/java/vaadin-app/
— the Vaadin applicationpackages/java/vaadin-app/package.json
— Vaadin app dependenciespackages/java/vaadin-app/node_modules/
— app specific npm dependencies
In a setup like that, Vaadin web component dependencies get “hoisted”, e. g., installed in the common upper node_modules
directory for ultimately being shared between my-component
and vaadin-app
. So even though a package is listed in packages/java/vaadin-app/package.json
, it could be actually installed to node_modules/
The Hilla repository is using a setup like that. Some IT projects in the Hilla repository fail with the following error:
Error: The build process encountered an error: Could not execute build-frontend goal Error occured during goal execution:
Failed to find the following css files in the `node_modules` or `.../hilla/packages/java/tests/spring/react-i18n/src/main/frontend` directory tree:
- @vaadin/vaadin-lumo-styles/lumo.css
The @vaadin/vaadin-lumo-styles
package is installed in the common node_modules/
, whereas Flow is expecting it to be in the app-specific directory.
Expected behavior
Flow using Node resolution rules when locating frontend packages and is able to use hoisted installation. This would be aligned with Vite and other Node-based tools.
Minimal reproducible example
See PR build: https://github.com/vaadin/hilla/actions/runs/16906563241/job/47897784956?pr=3871#step:7:1809
Versions
- Vaadin / Flow version: 25.0-SNAPSHOT
- Java version:
- OS version:
- Browser version (if applicable):
- Application Server (if applicable):
- IDE (if applicable):