flow: frontend compilation fails after upgrading to vaadin 23.1.0

Description of the bug

After upgrading to vaadin 23.1.0 I ran:

rm -rf target rm -rf node_modules npm i mvn install

When I try to restart tomcat I get the following error:

13 12:57:22,617 http-nio-8080-exec-1 USER: [ERROR] (CustomExceptionHandler.java:36) - Uncaught UI exception
 java.lang.IllegalStateException: Startup of Webpack failed. Output was:
[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
    at Command.<anonymous> (/home/bsutton/git/onepub/onepub_vaadin/node_modules/.pnpm/@webpack-cli+serve@1.7.0_8b27d5839a2bdf89ba2338e4c89fea10/node_modules/@webpack-cli/serve/lib/index.js:146:35)
    at async Promise.all (index 1)
    at async Command.<anonymous> (/home/bsutton/git/onepub/onepub_vaadin/node_modules/.pnpm/webpack-cli@4.9.2_9c3dcbfb57ee5c2fcb4d4b626946cc9c/node_modules/webpack-cli/lib/webpack-cli.js:1674:7)

	at com.vaadin.base.devserver.AbstractDevServerRunner.doStartDevModeServer(AbstractDevServerRunner.java:219) ~[vaadin-dev-server-23.1.0.jar:?]
	at com.vaadin.base.devserver.AbstractDevServerRunner.runOnFutureComplete(AbstractDevServerRunner.java:171) ~[vaadin-dev-server-23.1.0.jar:?]
	at com.vaadin.base.devserver.AbstractDevServerRunner.lambda$new$0(AbstractDevServerRunner.java:162) ~[vaadin-dev-server-23.1.0.jar:?]
	at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Expected behavior

tomcat should start without an error.

Minimal reproducible example

After upgrading to vaadin 23.1.0 I ran:

rm -rf target rm -rf node_modules npm i mvn install

Versions

  • Vaadin / Flow version: 23.1.0
  • Java version: OpenJDK 64-Bit Server VM (build 17.0.3+7-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)
  • OS version: Ubuntu: 22.04
  • Browser version (if applicable):
  • Application Server (if applicable): Apache Tomcat/9.0.36
  • IDE (if applicable): eclipse

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 21 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Instead of downgrading, maybe upgrading is easier

npm i webpack-cli@^4.10.0

This issue has been fixed in V23.1.1, V23.0.12 and V22.0.17.

Vaadin 14.8 and 10.0 have no such an issue.

Please let us know if you still experience any issues with webpack-cli by commenting to this ticket or creating a new one.

Will do.

On Fri, 17 June 2022, 6:00 pm Mikhail Shabarov, @.***> wrote:

@bsutton https://github.com/bsutton could you create a separate ticket for the Vite errors you’ve experienced ?

I’m going to close this ticket.

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/13952#issuecomment-1158604626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OCMQBYLY6MKF623LQTVPQWBBANCNFSM5YSX3A5A . You are receiving this because you were mentioned.Message ID: @.***>

Since Vaadin 22 is also still maintained, we also need to provide the fix there.

I think this command is problematic:

npm i @webpack-cli/serve@1.6.1 --save-dev

I ended up with

"@webpack-cli/serve": "^1.6.1",

Note the ^, which seems to result in it still running 1.7.x

I was flailing about somewhat to get this to work so can’t be certain the --save-dev command did the damage.

The change to make in the package.json would be:

"devDependencies": {
   "@webpack-cli/serve" : "1.6.1"
   ...
}

Or run npm i @webpack-cli/serve@1.6.1 --save-dev

One thing to note on manual changes to package.json is that you shouldn’t touch the vaadin{} object as that is used by the framework to check if the dependencies are manually altered or added to the package.json.

So if a item and version match in both dependencies and vaadin - dependencies or devDependencies and vaadin - devDependencies then the framework can automatically update or remove dependencies, which it will not do if the item is missing or has another version inside the vaadin object

It would seem that webpack-cli 4.9 is not compatible with cli/serve 1.7 see https://github.com/webpack/webpack-cli/issues/3294

As a workaround before a fix, defining the @webpack-cli/serve package.json dependency to v1.6.1 should fix the initial problem.