Production Build failed with 24.4.0.rc1

I get an error when trying a production build in a project upgraded from 24.3 to 24.4


[INFO] --- flow:24.1.13:build-frontend (default) @  ---
[INFO] Reflections took 861 ms to scan 247 urls, producing 13977 keys and 84609 values
[INFO] Scanning classes to find frontend configurations and dependencies...
[WARNING] Multiple npm versions for date-fns found:  [2.29.1, 2.29.3]. First version found '2.29.1' will be considered.
[INFO] Visited 16745 classes. Took 33387 ms.
[INFO] Checking if a production mode bundle build is needed
[WARNING] There is no production bundle in the classpath.
[INFO] No bundle's stats.json found for production-bundle validation.
[INFO] A production mode bundle build is needed
[INFO] Running `npm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
[INFO] using '/opt/homebrew/bin/npm --no-update-notifier --no-audit --scripts-prepend-node-path=true --ignore-scripts install' for frontend package installation
[INFO] Frontend dependencies resolved successfully.
node:internal/modules/cjs/loader:1227
  throw err;
  ^

Error: Cannot find module '/Users/simon/Workspace/customers/Dynasoft/tosca-ui/tosca-develop/node_modules/@vaadin/hilla-generator-cli/bin/index.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1224:15)
    at Module._load (node:internal/modules/cjs/loader:1050:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:168:12)
    at node:internal/main/run_main_module:30:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.1.0
[ERROR] Failed to run TypeScript endpoint generator
com.vaadin.hilla.engine.GeneratorException: Node execution failed
    at com.vaadin.hilla.engine.GeneratorProcessor.process(GeneratorProcessor.java:62)
    at com.vaadin.hilla.internal.TaskGenerateEndpointImpl.execute(TaskGenerateEndpointImpl.java:82)
    at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:312)
    at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:327)
    at com.vaadin.flow.plugin.maven.BuildFrontendMojo.execute(BuildFrontendMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:323)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:311)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:178)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:167)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:164)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:107)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:60)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleStarter.execute(DefaultLifecycleStarter.java:123)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:311)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:225)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:149)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:958)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:205)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke(Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: com.vaadin.hilla.engine.commandrunner.CommandRunnerException: Command failed with exit code 1: /opt/homebrew/bin/node
    at com.vaadin.hilla.engine.commandrunner.CommandRunner.executeCommand(CommandRunner.java:167)
    at com.vaadin.hilla.engine.commandrunner.CommandRunner.run(CommandRunner.java:98)
    at com.vaadin.hilla.engine.commandrunner.CommandRunner.run(CommandRunner.java:73)
    at com.vaadin.hilla.engine.GeneratorProcessor.process(GeneratorProcessor.java:50)
    at com.vaadin.hilla.internal.TaskGenerateEndpointImpl.execute(TaskGenerateEndpointImpl.java:82)
    at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:312)
    at com.vaadin.flow.plugin.base.BuildFrontendUtil.runNodeUpdater(BuildFrontendUtil.java:327)
    at com.vaadin.flow.plugin.maven.BuildFrontendMojo.execute(BuildFrontendMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:323)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:311)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:178)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:167)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:164)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:107)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:60)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleStarter.execute(DefaultLifecycleStarter.java:123)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:311)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:225)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:149)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:958)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:205)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke(Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

Sounds like this: Hilla maven plugin fails if a preexisting production bundle is available · Issue #1967 · vaadin/hilla · GitHub

Workaround options:

  • remove Hilla
  • forceProductionBuild=true
1 Like

I tried to clean everything. Didn’t help

In the log I see flow:24.1.13:build-frontend. Could it be that you are using an outdated plugin version?

Thank you @marcoc_753

Now I have to check who set the plugin version :sweat_smile:

1 Like