quasarframework / quasar-cli

[DEPRECATED, <= 0.17) Quasar Framework - CLI
https://quasar.dev
MIT License
202 stars 50 forks source link

Babel 7.0.0 integration #179

Open ppussar opened 6 years ago

ppussar commented 6 years ago

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

adamkpurdy commented 6 years ago

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.

wooliet commented 6 years ago

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?

adamkpurdy commented 6 years ago

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

wooliet commented 6 years ago

@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.

adamkpurdy commented 6 years ago

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

wooliet commented 6 years ago

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

kyriediculous commented 5 years ago

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/runtime@7.0.0-beta.54 -s