When I try to run the vaadinBuildFronteend gradle task in productionMode, the tasks takes hours to run on my Windows computer, I switch to my Mac and was surprised i takes less than a minute.
I used proccess explorer to figure out what it was stuck on and it appears to be stuck on running “node node_modules\@vaadin\hilla-generator-cli\bin\index.js -o C:\Users\Duncan\IdeaProjects\Project-Unity-work\src\main\frontend\generated -p @vaadin/hilla-generator-plugin-backbone -p @vaadin/hilla-generator-plugin-client -p @vaadin/hilla-generator-plugin-barrel -p @vaadin/hilla-generator-plugin-model -p @vaadin/hilla-generator-plugin-push -p @vaadin/hilla-generator-plugin-subtypes”
Running it manually i get this error:
DEBUG (tsgen): Processing OpenAPI
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Generator.process (file:///C:/Users/Duncan/IdeaProjects/Project-Unity-work/node_modules/@vaadin/hilla-generator-core/Generator.js:19:48)
at file:///C:/Users/Duncan/IdeaProjects/Project-Unity-work/node_modules/@vaadin/hilla-generator-cli/index.js:50:31
Node.js v20.17.0
I’m trying to figure out how to resolve this, I can run the project fine with productionMode disabled, but when it’s enabled it get’s stuck on Windows. I have tried reinstalling NPM, clearing Gradle caches, switching to pnpm, Vaadin Dance, …, but nothing seems to change anything.
I’m new to React and Vaadin, some notes about the project, it’s written in Kotlin, but the generated classes work fine.
Any help and suggestion would be highly appreciated, I’ll try to make replication project if needed later during the weekend.
Some difference is expected due to how Windows struggles with lots of small files. But the difference shouldn’t be that big even if your Windows machine has a spinning HDD.
One thing you could check for is if some kind of antivirus solution is interfering. You can try this by configuring your antivirus software (or Windows Defender if you haven’t installed anything on your own) to ignore the project directory.
I am using Windows 11, and typical Hilla build times with my demo project is few minutes, so if build takes on hour there is something abnormal. My project is however fairly small.
Does it eventually complete or does it seem like it keeps running forever? Does the process seem to use any CPU or I/O capacity at all or is just idle?
Did you try running the build with debug logging to see if there’s any hints there? I don’t remember how to do that with Gradle but with Maven it’s the -X flag.
You can try to set the vaadin.frontend.disableWritableFlagCheckOnCopy system property when building for production (-Dvaadin.frontend.disableWritableFlagCheckOnCopy=true) and see if it helps.
Can you check the contents of the hilla-openapi.json file in the build directory?
The node command receives its content as STDIN.
So when the command you run should be like node node_modules\@vaadin\hilla-generator-cli\bin\index.js ..... p @vaadin/hilla-generator-plugin-subtypes < target/hilla-openapi.json
(I’m not a Window user, so I’m not sure the STDIN redirection works the same)