Project can not build because an issue in @babel/parser

Hello community,

currently there is an issue with version 7.11.1 in @babel/parser: https://github.com/babel/babel/issues/11914, which leads to an exception when parsing the lit-element dependency.

ERROR in ../node_modules/lit-element/lib/decorators.js?babel-target=es6
Module build failed (from ../node_modules/babel-loader/lib/index.js):
SyntaxError: /data/volumes/jenkins-service/slave/var/jenkins/workspace/Tracy/test1/tracy-web/node_modules/lit-element/lib/decorators.js: Unexpected token (209:21)

  207 |     name) => {
  208 |         const descriptor = {
> 209 |             async get() {
      |                      ^
  210 |                 await this.updateComplete;
  211 |                 return this.renderRoot.querySelector(selector);
  212 |             },

The lit-element dependency is a default flow dependency. @babel/parser is a transitive dependency from the webpack-multi-target plugin, which is also a default vaadin flow dependency:

"webpack-babel-multi-target-plugin": {
      "version": "2.3.3",
      "resolved": "https://registry.npmjs.org/webpack-babel-multi-target-plugin/-/webpack-babel-multi-target-plugin-2.3.3.tgz",
      "integrity": "sha512-MJmv8YcP6ex4UgmFyafe8aTH7J9pcg90gFpeanb/48FRSqRpgdoidqmq3bNzHSvI1nOXeyT3EW2dmLYwMhmm2A==",
      "dev": true,
      "requires": {
        "@babel/cli": "^7.2.3",
        "@babel/core": "^7.2.2",
        "@babel/plugin-syntax-dynamic-import": "^7.2.0",
        "@babel/plugin-transform-runtime": "^7.2.0",
        "@babel/preset-env": "^7.3.1",
        "@babel/runtime": "^7.3.1",
        "babel-loader": "^8.0.5",
        "core-js": "^2.6.3",
        "html-webpack-plugin": "^3.2.0",
        "tapable": "^1.1.1",
        "webpack-merge": "^4.2.1",
        "webpack-sources": "^1.3.0"
      }
    }

To be able to build the project again, I need to downgrade the parser (or @babel/core) to version 7.11.0. But everytime I do so, the vaadin maven goals change the version in the package-json-lock back to 7.11.1.

Does anyone know how to keep my changes in the package-json-lock?

Regards,
Eric

Hi,

there was a 7.11.2 version released yesterday which should fix the problem

That’s true. But an option would be nice to manually downgrade a specific node module. In this case there was nothing I could do except to wait, because I could not downgrade @babel/parser to 7.11.0 temporarily.

With pnpm in use, it should be possible to force a version using pnpmfile.js but it seems that it still being overwritten with the default version on startup. See https://github.com/vaadin/flow/issues/8203