bootJar npm error

Jmix 2.3.4
when I try to build a Jar for production, I encounter an error
./gradlew -Pvaadin.productionMode=true bootJar like in the doc
the error:

#17 163.1 Execution failed for task ':vaadinBuildFrontend'.
#17 163.1 > Vite process exited with non-zero exit code.
#17 163.1   Stderr: 'vite v5.1.7 building for production...
#17 163.1   transforming...
#17 163.1   ✓ 414 modules transformed.
#17 163.1   x Build failed in 3.30s
#17 163.1   error during build:
#17 163.1   Error: [vite:css] [postcss] Preprocessor dependency "sass" not found. Did you install it? Try `npm install -D sass`.
#17 163.1   file: /usr/src/app/indigau/frontend/themes/app-indigau/styles.css:undefined:NaN
#17 163.1       at loadPreprocessorPath (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:32508:19)
#17 163.1       at process (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:32641:30)
#17 163.1       at compileCSSPreprocessors (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:31946:36)
#17 163.1       at Object.load (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-k5wXcrSr.js:32028:42)
#17 163.1       at async loadImportContent (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-qw1-Ctro.js:844:19)
#17 163.1       at async Promise.all (index 0)
#17 163.1       at async resolveImportId (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-qw1-Ctro.js:800:27)
#17 163.1       at async parseStyles$1 (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-qw1-Ctro.js:708:5)
#17 163.1       at async Object.Once (file:///usr/src/app/indigau/node_modules/vite/dist/node/chunks/dep-qw1-Ctro.js:971:22)
#17 163.1       at async LazyResult.runAsync (/usr/src/app/indigau/node_modules/postcss/lib/lazy-result.js:261:11)

I think I’m not supposed to install any nodeJS dependencies :thinking:
The only way to make it work is to remove the vaadin.productionMode=true

Thanks

Hi,

Unfortunately, I can’t reproduce the issue. Could you please attach a small demo project that reproduces the problem?

Regards,
Gleb

When trying to reproduce, I found what causes it. I try to import custom fonts in style.css

@import url('fonts/gilroy.scss');
@import url('fonts/materialIconsRegular.scss');

Furthermore, importing any empty .scss file from style.css make the bootJar fail with flag vaadin.productionMode.
So I renamed the files to .css, it fixed the bootJar issue but the materialIcons font is not loaded when running the jar.

You cannot mix CSS and SCSS files. Moreover, SCSS needs to be compiled into CSS and just changing file extension isn’t enough. Example of integrating of custom fonts can be found in the Vaadin documentation.