Build fails -- Used to work

I have a project that worked perfectly, and built just fine. Haven’t touched it in about 8 months, and now after a minor bug-fix the project won’t compile.
The whole maven/build/webpack process is pretty obscure (and terrifying) to me so when it doesn’t just work I’m totally stuck.

Here is the error output form the stage that is failing. (If it matters I’m using intellij and this is from the vaadin-mavin-plugin)

Failed to execute goal com.vaadin:vaadin-maven-plugin:14.1.3:build-frontend (default-cli) on project gateway: Webpack process exited with non-zero exit code.
Stderr: ''

Any help would be greatly appreciated. Thanks.

[INFO]
 
[INFO]
 --- vaadin-maven-plugin:14.1.3:build-frontend (default-cli) @ gateway ---
[INFO]
 Scanning classes to find frontend configurations and dependencies...
[INFO]
 Visited 1676 classes. Took 2244 ms.
[INFO]
 Visited 133 classes. Took 69 ms.
[INFO]
 Skipping `npm install`.
[INFO]
 Copying frontend resources from jar files ...
[INFO]
 Visited 122 resources. Took 206 ms.
[INFO]
 No js modules to update 'C:\devVaadin\gateway\gateway\target\frontend\generated-flow-imports-fallback.js' file
[INFO]
 No js modules to update 'C:\devVaadin\gateway\gateway\target\frontend\generated-flow-imports.js' file
[INFO]
 Running webpack ...
Hash: b537e72f735572a14bf6
Version: webpack 4.30.0
Time: 268ms
Built at: 2021-01-04 9:07:29 a.m.
 2 assets
Entrypoint bundle = build/vaadin-bundle-0b90cfa1b4373559f368.cache.js
Entrypoint bundle.es5 = build/vaadin-bundle.es5-1c274fb97bbad1490a1c.cache.js
[0]
 ../target/frontend/generated-flow-imports.js?babel-target=es6 3.51 KiB {0} [built]
 [failed]
 [1 error]

[1]
 ../target/frontend/generated-flow-imports.js?babel-target=es5 3.51 KiB {1} [built]
 [failed]
 [1 error]

ERROR in ../target/frontend/generated-flow-imports.js?babel-target=es6
Module build failed (from ../node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
: No "exports" main resolved in C:\devVaadin\gateway\gateway\node_modules\@babel\helper-compilation-targets\package.json
    at applyExports (internal/modules/cjs/loader.js:498:9)
    at resolveExports (internal/modules/cjs/loader.js:514:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:642:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1017:27)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at Object.<anonymous> (C:\devVaadin\gateway\gateway\node_modules\@babel\preset-env\lib\debug.js:8:33)
    at Module._compile (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at Object.<anonymous> (C:\devVaadin\gateway\gateway\node_modules\@babel\preset-env\lib\index.js:11:14)
    at Module._compile (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at requireModule (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\files\plugins.js:165:12)
    at loadPreset (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\files\plugins.js:83:17)
    at createDescriptor (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:154:9)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:109:50
    at Array.map (<anonymous>)
    at createDescriptors (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
    at createPresetDescriptors (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:58:104
    at cachedFunction (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (C:\devVaadin\gateway\gateway\node_modules\gensync\index.js:244:28)
    at sync (C:\devVaadin\gateway\gateway\node_modules\gensync\index.js:84:14)
    at presets (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
    at mergeChainOpts (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-chain.js:320:26)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-chain.js:283:7
ERROR in ../target/frontend/generated-flow-imports.js?babel-target=es5
Module build failed (from ../node_modules/babel-loader/lib/index.js):
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]
: No "exports" main resolved in C:\devVaadin\gateway\gateway\node_modules\@babel\helper-compilation-targets\package.json
    at applyExports (internal/modules/cjs/loader.js:498:9)
    at resolveExports (internal/modules/cjs/loader.js:514:23)
    at Function.Module._findPath (internal/modules/cjs/loader.js:642:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1017:27)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at Object.<anonymous> (C:\devVaadin\gateway\gateway\node_modules\@babel\preset-env\lib\debug.js:8:33)
    at Module._compile (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at Object.<anonymous> (C:\devVaadin\gateway\gateway\node_modules\@babel\preset-env\lib\index.js:11:14)
    at Module._compile (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (C:\devVaadin\gateway\gateway\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
    at requireModule (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\files\plugins.js:165:12)
    at loadPreset (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\files\plugins.js:83:17)
    at createDescriptor (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:154:9)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:109:50
    at Array.map (<anonymous>)
    at createDescriptors (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:109:29)
    at createPresetDescriptors (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:101:10)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:58:104
    at cachedFunction (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\caching.js:62:27)
    at cachedFunction.next (<anonymous>)
    at evaluateSync (C:\devVaadin\gateway\gateway\node_modules\gensync\index.js:244:28)
    at sync (C:\devVaadin\gateway\gateway\node_modules\gensync\index.js:84:14)
    at presets (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-descriptors.js:29:84)
    at mergeChainOpts (C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-chain.js:320:26)
    at C:\devVaadin\gateway\gateway\node_modules\@babel\core\lib\config\config-chain.js:283:7

Unfortunately, there was some issues in Vaadin 14.0 when the javascript bundle is building, perhaps 14.1 also.

In this link you have some explanation and some solutions: https://mvysny.github.io/Vaadin-troubleshooting/

If you still stuck, you can post your errors. Sometimes the error comes from a third party add-on, so you can also check the add-on you’re using.

In your case, it looks like this error:
Please perform the “Vaadin Dance” as mentioned above - it could be that the package-lock references an incompatible combination of package versions, or obsolete versions of tools such as Babel.

Solved.
Thanks so much for such a quick response.

I followed the guide you mentioned but none of the solutions there worked. But your comment that there were issues
in 14.0 & 14.1 led me to try upgrading to 14.4.5, and now the build works – great relief !