quasarframework / quasar-cli

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

Bare project failing to load in cordova #140

Closed Abuntxa closed 6 years ago

Abuntxa commented 6 years ago

Quasar-cli 0.16.4

OS: Windows 10, Android 6.0 Node: 8.11.2 NPM: 5.6.0 Cordova: 8.0.0

The bare minimum project fails to load in cordova

Steps to reproduce

Open "Visual Studio Emulator for Android" and start an Android 6.0 device with checked conectivity to the desktop. quasar init myApp1 cd myApp1 quasar dev -m cordova -T android

Everything compiles and deploys fine but the application shows a blank page. After that I tried to access a normal dev server from the android device: quasar dev I didn't get any conectivity problems, but still the same blanck page; and therefore I attached my desktop chrome development tools to the remote device. On the console, I could see the error Uncaught SyntaxError: Use of const in strict mode. on index.js?7671:2

The content of Index.js?7671

'use strict';
const ansiRegex = require('ansi-regex');
module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;

Looking at the network timeline I can see the full response of the file:

{
 "version":3,
 "file":"./node_modules/strip-ansi/index.js.js",
 "sources":["webpack:///./node_modules/strip-ansi/index.js?7671"],
 "sourcesContent":["'use strict';\nconst ansiRegex = require('ansi-regex');\n\nmodule.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;\n"],
 "mappings":"AAAA;AACA;AACA;AACA;",
 "sourceRoot":""}
rstoenescu commented 6 years ago

Hi,

This is actually a bug in npm. If you're on Windows (and you are), please use yarn which is far better. This is also in docs.