flow: Vaadin 24.x Build fails: Rollup failed to resolve import "@vaadin/button/src/vaadin-button-base.js"

Description of the bug

This error has appeared for the first time yesterday on our CI server during build, while it did not occur on my development machine.

After cleaning caches and trying various Vaadin upgrades (currently on 24.6.5 and tried up to 24.7.0), the error now also appears on my development machine. So it has something to do with the environment, apparently cleaning up has removed some crucial file. Here is the build command and log output:

./gradlew -Dvaadin.force.production.build=true clean build

Execution failed for task ':my-app:vaadinBuildFrontend'.
> Vite process exited with non-zero exit code.
  Stderr: 'vite v6.0.11 building for production...
  transforming...
  ✓ 155 modules transformed.
  vite v6.0.11 building for production...
  transforming...
  ✓ 79 modules transformed.
  rendering chunks...
  computing gzip size...
  ../../../build/resources/main/META-INF/VAADIN/webapp/sw.js  19.33 kB │ gzip: 6.48 kB
  ✓ built in 665ms
  x Build failed in 1.64s
  error during build:
  [vite]: Rollup failed to resolve import "@vaadin/button/src/vaadin-button-base.js" from "/xxx/xxx/work/git/xxx/my-app/node_modules/@vaadin/app-layout/src/vaadin-drawer-toggle.js".
  This is most likely unintended because it can break your application at runtime.
  If you do want to externalize this module explicitly add it to
  `build.rollupOptions.external`
      at viteWarn (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/vite@6.0.11_terser@5.43.0/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:51220:17)
      at Object.onwarn (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.vite-temp/vite.config.ts.timestamp-1750236091742-6cf765c6cef19.mjs:1209:11)
      at onwarn (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/@vitejs+plugin-react@4.3.4_vite@6.0.11_terser@5.43.0_/node_modules/@vitejs/plugin-react/dist/index.mjs:280:40)
      at onRollupWarning (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/vite@6.0.11_terser@5.43.0/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:51250:5)
      at onwarn (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/vite@6.0.11_terser@5.43.0/node_modules/vite/dist/node/chunks/dep-M1IYMR16.js:50918:7)
      at file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/rollup@4.43.0/node_modules/rollup/dist/es/shared/node-entry.js:20798:13
      at Object.logger [as onLog] (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/rollup@4.43.0/node_modules/rollup/dist/es/shared/node-entry.js:22664:9)
      at ModuleLoader.handleInvalidResolvedId (file:///xxx/xxx/work/git/xxx/my-app/node_modules/.pnpm/rollup@4.43.0/node_modules/rollup/dist/es/shared/node-entry.js:21410:26)
      at file:///sss/sss/work/git/sss/my-app/node_modules/.pnpm/rollup@4.43.0/node_modules/rollup/dist/es/shared/node-entry.js:21368:26
  '

I have also tried building with -Dvaadin.pnpm.enable=false, but this had no effect.

Expected behavior

The Build should run, as it did before I cleaned all my caches. I did not change anything in the application.

Minimal reproducible example

It’s an environment issue. It did not appear after making any changes to the application, but after cleaning local caches, running vaadinClean etc.

Versions

  • Vaadin / Flow version: 24.6.5
  • Java version: openjdk version “21.0.7” 2025-04-15
  • OS version: Fedora release 42
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 30 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Ok we have used a new solution based on info above and in related issues

For developers machines - disable pnpm via application.yml in spring boot app: vaadin.pnpm.enabled: false. Do this in dev profile ideally 🙂 don’t forget to revert package.json to default version without static versions.

For CI there is setting for maven in pom.xml in vaadin build plugin. There you can disable pnpm too.

Now everything is working again. Keep pnpm diassabled until it’s fixed

JS

this is a critical bug, actually crash all our projects builds. my workaround is to change in pom.xml pnpmEnable to false: <plugin> <groupId>com.vaadin</groupId> <artifactId>vaadin-maven-plugin</artifactId> <version>${vaadin.version}</version> <executions> <execution> <goals> <goal>prepare-frontend</goal> </goals> </execution> </executions> <configuration> <pnpmEnable>false</pnpmEnable> <frontendHotdeploy>true</frontendHotdeploy> </configuration> </plugin>