I am migrating a Vaadin Springboot/Gradle application from Vaadin 14.5.1 to 14.6.1. I copied the new file(s) from the themes folder from a freshly generated app from start.vaadin.com, in particular frontend/themes/my-app/styles.css
@import url('lumo-css-framework/all-classes.css');
When running the vaadinBuildFrontend
task, I receive the following error (deep in other messages):
ERROR in ./themes/my-app/styles.css
Module build failed (from ../node_modules/css-loader/dist/cjs.js):
Error: Can't resolve 'lumo-css-framework/all-classes.css' in '/Users/<..>/my-app/frontend/themes/my-app
All build dependencies are seemingly the same as in the sample maven project. All generated files had been deleted prior to building the frontend.
After comparing the generated files, I found that the sample maven project contains "lumo-css-framework": "^3.0.11"
in the generated package.json
, while the gradle project does not contain this.
The environment:
- Spring 2.5.0
- Gradle 7.0.1
- Vaadin Gradle plugin 0.14.6.0
- macOS 11.2.3 and Centos 7
What am I missing in the setup?
npm install --save lumo-css-framework
works, untilgradle vaadinClean
is executed. The next build then creates a newpackage.json
. So this is not a sustainable approach. Adding@NpmPackage(value="lumo-css-framework", version="^3.0.11")
works as you suggested and fixes the problem. I still think, though, that Vaadin should figure this out automatically, as the documentation explicitly states that all themes are based on Lumo. Thumbs up for your suggestion anyways!. Thanks. – Balmoral