Missing babel dependency in production build

Can someone please help me understand following error. I have successfully built production version 5 days ago, and today I cant, even though I have not changed anything in my dependencies, but I did delete node-modules folder, package-lock.json and webpack.generated.js (as I usualy do for production build) which is now missing some previously downloaded subfolders.

During build-frontend goal i get the following exception:
Cannot find package ‘@babel/plugin-proposal-object-rest-spread’

I am using Vaadin 14+, Spring, Maven and NodeJS

Why cant I expect same node-modules to be downloaded everytime i run the same build?


You should not delete package-lock.json if you want reproducible builds

Previously I had to, otherwise I was getting blank white page in production environment … maybe that has been fixed now … will try to revert that file

You do not get a blank page by keeping package-lock.json unless there is something wrong with that particular package-lock.json. It defines the versions of npm packages to use.

You are right, it probably was something else wrong, but I could not fix it until I removed those files. Thanks for help … I managed to revert package-lock.json and node_modules folder, so build is working again. Tnx