Search code examples
vue.jsbabeljsquasar-frameworkquasarbabel-loader

Quasar - Missing .babelrc file


I have an old project build with quasar, it was working good, until I changed my machine. when I try to run quasar dev I got this error:

⚠️ Missing .babelrc file...

While the same code works well on the old machine without .babelrc file needed.

My env:

node v12.22.12 
npm v6.14.16
quasar-cli 0.17.26

I tried to add this missing .babelrc file manually.

{
  "plugins": [
    "transform-es2015-arrow-functions",
    "check-es2015-constants",
    "transform-es2015-block-scoping"
  ]
}

but it shows me other more errors, because I don't know what exactly the content of it.

Module build failed (from ./node_modules/babel-loader/lib/index.js):
  Error: Cannot find module 'babel-plugin-transform-es2015-arrow-functions'

I just tried to install these plugins but not work, keeps showing new errors.

error  in ./.quasar/app.styl
  Module build failed (from ./node_modules/stylus-loader/index.js):

I believe there is a solution without adding this file at all

I appreciate your help


Solution

  • The issue seemed related to quasar-cli versions.

    I finally resolved it, by using npx quasar dev instead of using the global quasar-cli.

    Thanks to @EstusFlask for providing me with this Idea as he said

    Make sure you use the same quasar cli version on both machines, this is likely the way the machines are different. The project should preferably rely on local deps instead of global commands, i.e. have quasar-cli in devDependencies and use npx quasar instead of quasar if possible

    I should use npx quasar from now and ever for running and building my apps rather than depending on the global quasar.