Recently our vaadin production build has started failing and I'm too much of a node noob to figure out if this is a local problem or if it is related to vaadin 20.
When I switch back to vaadin 19 the problem goes away and I can reproduce the problem with an application generated on https://start.vaadin.com/app/
When running: ./mvnw package -P production
I get the following error:
[INFO] -------------------< com.example.application:myapp >--------------------
[INFO] Building Project base for Spring Boot and Vaadin Flow 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ myapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- vaadin-maven-plugin:20.0.5:prepare-frontend (default) @ myapp ---
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 163 resources. Took 88 ms.
[INFO]
[INFO] --- vaadin-maven-plugin:20.0.5:build-frontend (default) @ myapp ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 1876 classes. Took 1089 ms.
[INFO] Visited 108 classes. Took 31 ms.
[INFO] Skipping `pnpm install` because the frontend packages are already installed in the folder '/home/me/devel/my-app/node_modules' and the hash in the file '/home/me/devel/my-app/node_modules/.vaadin/vaadin.json' is the same as in 'package.json'
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 163 resources. Took 45 ms.
[INFO] Running webpack ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.769 s
[INFO] Finished at: 2021-08-06T13:40:23+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:20.0.5:build-frontend (default) on project myapp: Execution default of goal com.vaadin:vaadin-maven-plugin:20.0.5:build-frontend failed: Webpack process exited with non-zero exit code.
[ERROR] Stderr: '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js:93
[ERROR] throw err;
[ERROR] ^
[ERROR]
[ERROR] Error: Cannot find module 'workbox-build/build/options/schema/webpack-generate-sw'
[ERROR] Require stack:
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js
[ERROR] - /home/me/devel/my-app/webpack.generated.js
[ERROR] - /home/me/devel/my-app/webpack.config.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/utils/convert-argv.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js
[ERROR] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js:20:33)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js:10:20)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/webpack.generated.js:10:28)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/webpack.config.js:10:22)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
[ERROR] code: 'MODULE_NOT_FOUND',
[ERROR] requireStack: [
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js',
[ERROR] '/home/me/devel/my-app/webpack.generated.js',
[ERROR] '/home/me/devel/my-app/webpack.config.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/utils/convert-argv.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js'
[ERROR] ]
[ERROR] }
[ERROR] ': Unexpected exit value: 1, allowed exit values: [0], executed command [/usr/local/bin/node, /home/me/devel/my-app/node_modules/webpack/bin/webpack.js] in directory /home/me/devel/my-app with environment { redacted }, output was 5013 bytes (truncated):
[ERROR] /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js:93
[ERROR] throw err;
[ERROR] ^
[ERROR]
[ERROR] Error: Cannot find module 'workbox-build/build/options/schema/webpack-generate-sw'
[ERROR] Require stack:
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js
[ERROR] - /home/me/devel/my-app/webpack.generated.js
[ERROR] - /home/me/devel/my-app/webpack.config.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/utils/convert-argv.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js
[ERROR] - /home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js
[ERROR] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js:20:33)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js:10:20)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modul
[ERROR] ...
[ERROR] -cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/webpack.generated.js:10:28)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[ERROR] at Module.require (node:internal/modules/cjs/loader:1005:19)
[ERROR] at require (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
[ERROR] at Object.<anonymous> (/home/me/devel/my-app/webpack.config.js:10:22)
[ERROR] at Module._compile (/home/me/devel/my-app/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[ERROR] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[ERROR] at Module.load (node:internal/modules/cjs/loader:981:32)
[ERROR] at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
[ERROR] code: 'MODULE_NOT_FOUND',
[ERROR] requireStack: [
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/generate-sw.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/workbox-webpack-plugin/build/index.js',
[ERROR] '/home/me/devel/my-app/webpack.generated.js',
[ERROR] '/home/me/devel/my-app/webpack.config.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/utils/convert-argv.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-cli/bin/cli.js',
[ERROR] '/home/me/devel/my-app/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack/bin/webpack.js'
[ERROR] ]
[ERROR] }
On my local machine (macOs 11.4) I have node v16.6.1 installed, but it also fails on our jenkins server where node is not installed.
Best regards Jens
This is a webpack problem and is being currently addressed via https://github.com/vaadin/flow/pull/11527
Edit: The fix is included in the latest Vaadin 20.0.6 release via Vaadin Flow 7.0.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With