quasarframework / quasar-cli

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

quasar dev/build "Failed to compile with X errors" but no error shown #193

Closed huafu closed 5 years ago

huafu commented 5 years ago

Software version

OS: Darwin 17.7.0 x86_64 i386 Node: 10.12.0 NPM: 6.4.1 yarn: 1.10.1 lerna: 3.4.3

What did you get as the error?

❯ yarn start # => quasar dev -m pwa -H app.local.exmaple.com, but with defaults it is the same
yarn run v1.10.1
$ quasar dev -m pwa -H app.local.example.com

 Dev mode.......... pwa
 Quasar theme...... mat
 Quasar CLI........ v0.17.20
 Quasar Framework.. v0.17.17
 Debugging......... enabled

 app:quasar-conf Reading quasar.conf.js +0ms
 app:dev Checking listening address availability (app.local.example.com:8080)... +7ms
 app:workbox [GenerateSW] Will generate a service-worker file. Ignoring your custom written one. +1s
 app:workbox ⚠️  Forcing PWA into the network-first approach to not break Hot Module Replacement while developing. +1ms
 app:webpack Chaining PWA Webpack config +1ms
 app:generator Generating Webpack entry point +20ms
 app:dev-server Booting up... +4ms

  PWA █████████████████████████ [100%] in ~1s

 ERROR  Failed to compile with 8 errors 

(that is ALL the output)

What were you expecting?

A list of errors so that I can debug/fix them ;-)

What steps did you take, to get the error?

I created a lerna mono repo using yarn workspaces. Then created my Quasar App in packages/app, and at the end I asked it to let me install dependencies, at which step I came back in the root of my mono repo and ran lerna bootstrap to make it install dependencies.

huafu commented 5 years ago

Turns out this is a yarn workspaces related issue, if it can help someone, here is how to fix it:

Change your workspaces option of the root package.json:

diff --git a/package.json b/package.json
index 9084924..4ecd3c1 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,13 @@
   "devDependencies": {
     "lerna": "^3.4.3"
   },
-  "workspaces": [
-    "packages/*"
-  ]
+  "workspaces": {
+    "packages": [
+      "packages/*"
+    ],
+    "nohoist": [
+      "**/quasar-cli",
+      "**/quasar-cli/**"
+    ]
+  }
 }
ghost commented 5 years ago

I have the same error but I use npm, not yarn. :(There are no error details.

quasar dev

 Dev mode.......... spa
 Quasar theme...... mat
 Quasar CLI........ v0.17.24
 Quasar Framework.. v0.17.20
 Debugging......... enabled

 app:quasar-conf Reading quasar.conf.js +0ms
 app:dev Checking listening address availability (0.0.0.0:8080)... +4ms
 app:webpack Extending SPA Webpack config +426ms
 app:generator Generating Webpack entry point +8ms
 app:dev-server Booting up... +2ms

  SPA █████████████████████████ [100%] in ~8s

 ERROR  Failed to compile with 1 errors                                                                                                          4:25:24 PM

 error  in ./.quasar/import-quasar.js

Module build failed (from ./node_modules/babel-loader/lib/index.js):
  Error: Unknown import from Quasar: vualidate

  - imports.mat.js:167 module.exports
    [potential-user]/[quasar-framework]/dist/babel-transforms/imports.mat.js:167:11

  - index.js:64 transform
    [potential-user]/[babel-plugin-transform-imports]/index.js:64:16

  - index.js:138 
    [potential-user]/[babel-plugin-transform-imports]/index.js:138:39

  - Array.forEach

  - index.js:121 PluginPass.ImportDeclaration
    [potential-user]/[babel-plugin-transform-imports]/index.js:121:35

  - visitors.js:193 newFn
    [potential-user]/[core]/[@babel]/traverse/lib/visitors.js:193:21

  - context.js:53 NodePath._call
    [potential-user]/[core]/[@babel]/traverse/lib/path/context.js:53:20

  - context.js:40 NodePath.call
    [potential-user]/[core]/[@babel]/traverse/lib/path/context.js:40:17

  - context.js:88 NodePath.visit
    [potential-user]/[core]/[@babel]/traverse/lib/path/context.js:88:12

  - context.js:118 TraversalContext.visitQueue
    [potential-user]/[core]/[@babel]/traverse/lib/context.js:118:16
rstoenescu commented 5 years ago

@hipertracker2 Did you notice Error: Unknown import from Quasar: vualidate in your error above? Are you trying to add "vualidate" (actually "vuelidate"?) in quasar.conf.js > framework > components? Cause that's not the way, that is the place for importing Quasar components only.