quasar-cli icon indicating copy to clipboard operation
quasar-cli copied to clipboard

Babel 7.0.0 integration

Open ppussar opened this issue 6 years ago • 7 comments

Software version

OS: macos 10.13.6 Node: v10.10.0 NPM: 6.4.1 Any other software related to your bug:

What did you get as the error?

Babel has removed core-js from the runtime package https://github.com/babel/babel/releases/tag/v7.0.0-beta.56

quasar build results in an error using babel 7.0.0-beta.56 or above: (node:6214) UnhandledPromiseRejectionWarning: Error: Cannot find module '@babel/runtime/core-js/get-iterator'

What were you expecting?

QuasarCli should work with the latest babel 7.0.0 release.

What steps did you take, to get the error?

quasar build using babel 7.0.0

ppussar avatar Sep 14 '18 10:09 ppussar

I was experiencing this same problem.

I followed along here: http://babeljs.io/docs/en/next/babel-plugin-transform-runtime

Basically I removed the old babel runtime in my package.json : "@babel/runtime": "^7.0.0-beta.56", and replaced it with: "@babel/runtime-corejs2": "^7.0.0",.

I also updated my .bablerc under plugins:

[
      "@babel/plugin-transform-runtime", {
        "corejs": 2,
        "regenerator": true,
        "helpers": true
      }
]

quasar build is now working as expected for me.

adamkpurdy avatar Sep 16 '18 22:09 adamkpurdy

I'm using quasar cli v0.17.19 and am running into the "Cannot find module '@babel/runtime/core-js/get-iterator'" issue.

Are there any "official" instructions or update procedures from quasar team?

wooliet avatar Oct 02 '18 01:10 wooliet

@wooliet did you try the approach I posted? You need to update your package.json & your .bablerc in the plugins array.

adamkpurdy avatar Oct 02 '18 13:10 adamkpurdy

@adamkpurdy, the problem turned out to be one of our other dependencies.

However, we did try your steps but it did not resolve the issue.

wooliet avatar Oct 02 '18 17:10 wooliet

@wooliet Oh interesting, just curious, but what dependency was the issue for you guys?

adamkpurdy avatar Oct 02 '18 17:10 adamkpurdy

https://github.com/GetStream/stream-js

wooliet avatar Oct 02 '18 20:10 wooliet

The error appears to be that quasar will throw this when any installed package that uses babel , uses a higher version than quasar's

Then again it doesn't happen on a clean install after installing that package. So somewhere along the way my dependency tree must have gotten messed up.

Edit:

You have to manually roll back the changes in your package-lock like @adamkpurdy said.

I did however roll back to an older version and did not have to change anything in my quasar config file.

OR tell quasar dependencies to use the version that is in your package-lock but I have not tried this and this might break other things.

npm uninstall @babel/runtime -s

npm install @babel/[email protected] -s

kyriediculous avatar Feb 01 '19 17:02 kyriediculous