Webpack error

Hello. My production build stopped working and I can’t find the reason for errors. Does anyone have a clue, what could be a problem? I am having this problem only on production server, where app is built with jenkins. I reverted code changes in project to latest working code, but error still appears and app cant be built.

Here is one of many (similar) errors that started occuring

ERROR in /var/lib/jenkins/workspace/e2-vaadin-prod/e2-vaadin/node_modules/@types/node/ts4.8/test.d.ts [tsl] ERROR in /var/lib/jenkins/workspace/e2-vaadin-prod/e2-vaadin/node_modules/@types/node/ts4.8/test.d.ts(612,34) TS1005: '?' expected.

Anyone? I am not using typescript directly anywhere in project (configuration is generated by vaadin-maven-plugin), but still it breaks build. I found other libraries having similar problems recently …

Depending on your used Vaadin Version, you could manually install nodejs 16.x for the time being if the error is related to nodejs 18.x as some of your links have suggested.

i tried with 16.x and with 12.x with same result … locally i have 12.x it stopped working today here too after i added “clean-frontend” to vaadin-maven-plugin goals :see_no_evil:

i am using vaadin 14.9.2 … tried to downgrade to previous working version 14.8.3 and im getting same error :see_no_evil:

That information about Vaadin 14.x is a good clue. No idea, I’m using 23/24

its crazy … i delete node_modules folder, package.json and package-lock, … then run npm clean-install and i get this file where node is defined as 18.4.2 version always and I dont know where does that come …

node_modules/@types/node/package.json

You should NEVER call npm in a flow project. Make sure that nodejs is globally downgraded to your defined version and make sure the .vaadin folder inside your home is deleted

i usualy dont, except localy where things get wild sometimes :slightly_smiling_face: … on jenkins server i dont even have global nodejs installed on server … im using it on job level inside jenkins, and getting same error on different machines
package.json (7.11 KB)

Well you should definitely install it in Jenkins properly. Don’t tell your IT department you are running Jenkins Jobs that happily download and execute binaries from the internet😉

well its hard not to tell when you’re all in one person :nerd_face: :smile:

anyway … i solved it (for now) by explicitly defining node version in package.json file by adding this one line :smile:@types/node": "~18.11.9"