fs.existsSync is not a function in Angular (5) - angular5

I'm trying to run an Angular 5 app through Visual Studio Code - the code compiles without errors, but I'm receiving a "fs.existsSync is not a function" error when viewing it on localhost:4200. The full error message is
module.exports< devmode.js:33 <anonymous> devmode.js:31 <anonymous> devmode.js:1 ./node_modules/selenium-webdriver/lib/devmode.js http://localhost:4200/vendor.bundle.js:1084:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 <anonymous> http.js:32 <anonymous> http.js:1 ./node_modules/selenium-webdriver/lib/http.js http://localhost:4200/vendor.bundle.js:1108:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 <anonymous> index.js:29 <anonymous> index.js:1 ./node_modules/selenium-webdriver/http/index.js http://localhost:4200/vendor.bundle.js:1044:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 <anonymous> login.component.ts:1 ./src/app/login/login.component.ts http://localhost:4200/main.bundle.js:284:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 <anonymous> app.module.ts:24 ./src/app/app.module.ts http://localhost:4200/main.bundle.js:107:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 <anonymous> main.ts:4 ./src/main.ts http://localhost:4200/main.bundle.js:403:1
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 [0] http://localhost:4200/main.bundle.js:411:18
__webpack_require__ http://localhost:4200/inline.bundle.js:55:12 webpackJsonpCallback http://localhost:4200/inline.bundle.js:26:23 <anonymous> http://localhost:4200/main.bundle.js:1:1
Other questions relating to this error mention Electron, but I'm not using that package.
I'm new to all of this and so don't know what other information I should be providing. If it helps, my npm version is 5.6.0, node is version 6.11.0 and the contents of my package.json are:
"dependencies": {
"#angular/animations": "^5.2.0",
"#angular/common": "^5.2.0",
"#angular/compiler": "^5.2.0",
"#angular/core": "^5.2.0",
"#angular/forms": "^5.2.0",
"#angular/http": "^5.2.0",
"#angular/platform-browser": "^5.2.0",
"#angular/platform-browser-dynamic": "^5.2.0",
"#angular/router": "^5.2.0",
"core-js": "^2.4.1",
"ngx-bootstrap": "^2.0.2",
"ngx-cookie-service": "^1.0.10",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"#angular/cli": "~1.7.0",
"#angular/compiler-cli": "^5.2.0",
"#angular/language-service": "^5.2.0",
"#types/jasmine": "~2.8.3",
"#types/jasminewd2": "~2.0.2",
"#types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
What do I need to be looking for in my code to fix this error?
Thanks

Well, it appears to have been a rogue auto-import from your editor. It was importing HttpClient from WebDriver and not Angular.
Use this:
import { HttpClient } from '#angular/common/http';

Related

Module build failed (from ./node_modules/vue-loader/dist/index.js) when adding Nuxt SSR into vue 2

Module build failed (from ./node_modules/vue-loader/dist/index.js): friendly-errors 15:42:31
TypeError: Cannot read property 'styles' of undefined
at Object.loader (/home/<name>/Documents/<project>/node_modules/vue-loader/dist/index.js:70:34)
friendly-errors 15:42:31
# ./.nuxt/index.js 26:0-52 312:0-32
# ./.nuxt/client.js
# multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js ./node_modules/webpack-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
I spend a lot of time for this error. What should I do?
edit:
I just want to add nuxt ssr into an existing vue 2 project. I just ran into this problem.
Here are some information:
This is the error page I get:
error page
this is package.json dependencies
"#nuxt/core": "^2.15.7",
"#nuxtjs/robots": "^2.5.0",
"#nuxtjs/sitemap": "^2.4.0",
"axios": "^0.21.1",
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.23.1",
"core-js": "^3.6.5",
"emittery": "^0.11.0",
"express": "^4.17.1",
"firebase": "^7.17.1",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.25",
"moment": "^2.27.0",
"moment-timezone": "^0.5.31",
"node-sass": "^7.0.1",
"nuxt": "^2.15.7",
"nuxt-start": "^2.15.8",
"on-screen-keyboard-detector": "^2.3.0",
"raw-loader": "^4.0.2",
"register-service-worker": "^1.7.1",
"string-format-validation": "^2.0.2",
"sweetalert": "^2.1.2",
"v-calendar": "^2.4.1",
"validator": "^13.1.1",
"vue": "^2.7.5",
"vue-barcode-reader": "^0.0.3",
"vue-directive-long-press": "^1.1.0",
"vue-form-generator": "^2.3.4",
"vue-i18n": "^8.22.0",
"vue-js-toggle-button": "^1.3.3",
"vue-material-design-ripple": "^1.0.0",
"vue-meta": "^2.4.0",
"vue-qrcode-reader": "^3.0.1",
"vue-router": "^3.1.6",
"vue-select": "^3.11.2",
"vue-server-renderer": "2.7.14",
"vue-simple-alert": "^1.1.1",
"vue-template-compiler": "^2.6.14",
"vuejs-datepicker": "^1.6.2",
"vuex": "^3.2.0"
I have tried deleting node_modules folder and run yarn install but still not fixed

Angular 11 firebase site not launching

I've been working on an Angular11 firebase website, and I have managed to break something that has completely lost me. I did an npm audit that managed to break everything
I've tried removing and reinstalling everything I can, as well as starting a new project and readding
The Error:
TypeError: Cannot read property 'toString' of undefined
at new AngularFireModule (c:\nodejs\pt-web\node_modules\#angular\fire\__ivy_ngcc__\fesm2015\angular-fire.js:481:17)
at Object.factory (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:11332:1)
at R3Injector.hydrate (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:11385:1)
at R3Injector.get (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:11205:1)
at c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:11242:1
at Set.forEach (<anonymous>)
at R3Injector._resolveInjectorDefTypes (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:11242:1)
at new NgModuleRef$1 (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:25228:1)
at NgModuleFactory$1.create (c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:25282:1)
at http://localhost:4200/vendor.js:114008:45 {stack: 'TypeError: Cannot read property 'toString' of… at http://localhost:4200/vendor.js:114008:45', message: 'Cannot read property 'toString' of undefined'}
arg0: TypeError: Cannot read property 'toString' of undefined
at new AngularFireModule (http://localhost:4200/vendor.js:138898:118)
at Object.factory (http://localhost:4200/vendor.js:96231:58)
at R3Injector.hydrate (http://localhost:4200/vendor.js:96284:35)
at R3Injector.get (http://localhost:4200/vendor.js:96104:33)
at http://localhost:4200/vendor.js:96141:55
at Set.forEach (<anonymous>)
at R3Injector._resolveInjectorDefTypes (http://localhost:4200/vendor.js:96141:31)
at new NgModuleRef$1 (http://localhost:4200/vendor.js:110127:26)
at NgModuleFactory$1.create (http://localhost:4200/vendor.js:110181:16)
at http://localhost:4200/vendor.js:114008:45 {stack: 'TypeError: Cannot read property 'toString' of… at http://localhost:4200/vendor.js:114008:45', message: 'Cannot read property 'toString' of undefined'}
message: 'Cannot read property 'toString' of undefined'
stack: 'TypeError: Cannot read property 'toString' of undefined\n at new AngularFireModule (http://localhost:4200/vendor.js:138898:118)\n at Object.factory (http://localhost:4200/vendor.js:96231:58)\n at R3Injector.hydrate (http://localhost:4200/vendor.js:96284:35)\n at R3Injector.get (http://localhost:4200/vendor.js:96104:33)\n at http://localhost:4200/vendor.js:96141:55\n at Set.forEach (<anonymous>)\n at R3Injector._resolveInjectorDefTypes (http://localhost:4200/vendor.js:96141:31)\n at new NgModuleRef$1 (http://localhost:4200/vendor.js:110127:26)\n at NgModuleFactory$1.create (http://localhost:4200/vendor.js:110181:16)\n at http://localhost:4200/vendor.js:114008:45'
__proto__: Error
<anonymous> # c:\nodejs\pt-web\src\main.ts:12:25
invoke # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:364
run # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:123
<anonymous> # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:857
invokeTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:399
runTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:167
drainMicroTaskQueue # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:569
◀ Promise.then ▶
scheduleMicroTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:552
scheduleTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:388
scheduleTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:210
scheduleMicroTask # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:230
scheduleResolveOrReject # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:847
then # c:\nodejs\pt-web\node_modules\zone.js\dist\zone-evergreen.js:979
bootstrapModule # c:\nodejs\pt-web\node_modules\#angular\core\__ivy_ngcc__\fesm2015\core.js:29159
zUnb # c:\nodejs\pt-web\src\main.ts:11:26
__webpack_require__ # c:\nodejs\pt-web\webpack\bootstrap:84
0 # localhost꞉4200/main.js:11:18
__webpack_require__ # c:\nodejs\pt-web\webpack\bootstrap:84
checkDeferredModules # c:\nodejs\pt-web\webpack\bootstrap:45
webpackJsonpCallback # c:\nodejs\pt-web\webpack\bootstrap:32
<anonymous> # localhost꞉4200/main.js:1:57
[WDS] Live Reloading enabled.
package.json
{
"name": "mega-able",
"version": "1.3.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#agm/core": "^1.1.0",
"#angular/animations": "^11.1.2",
"#angular/common": "^11.1.2",
"#angular/compiler": "^11.1.2",
"#angular/core": "^11.2.7",
"#angular/fire": "^6.1.4",
"#angular/forms": "^11.1.2",
"#angular/localize": "^11.2.7",
"#angular/platform-browser": "^11.1.2",
"#angular/platform-browser-dynamic": "^11.1.2",
"#angular/router": "^11.1.2",
"#fullcalendar/angular": "^5.6.0",
"#fullcalendar/core": "^5.6.0",
"#fullcalendar/daygrid": "^5.6.0",
"#fullcalendar/interaction": "^5.6.0",
"#fullcalendar/timegrid": "^5.6.0",
"#ng-bootstrap/ng-bootstrap": "^7.0.0",
"#swimlane/ngx-datatable": "^17.1.0",
"angular": "^1.8.2",
"angular-archwizard": "^6.1.0",
"angular-datatables": "^9.1.1",
"angular-pell": "^0.1.0",
"angular-tree-component": "^8.5.6",
"angular2-chartjs": "^0.5.1",
"angular2-text-mask": "^9.0.0",
"bootstrap": "^4.6.0",
"c3": "^0.7.20",
"d3": "^5.16.0",
"datatables.net": "^1.10.24",
"datatables.net-buttons": "^1.7.0",
"datatables.net-buttons-dt": "^1.7.0",
"datatables.net-colreorder": "^1.5.3",
"datatables.net-dt": "^1.10.24",
"datatables.net-responsive": "^2.2.7",
"datatables.net-select": "^1.3.3",
"famfamfam-flags": "^1.0.0",
"firebase": "^8.3.1",
"firebaseui": "^4.8.0",
"font-awesome-scss": "^1.0.0",
"fullcalendar": "^5.6.0",
"hammerjs": "^2.0.8",
"jquery": "^3.6.0",
"jszip": "^3.6.0",
"netmask": "^2.0.1",
"ng-click-outside": "^6.0.0",
"ng-select": "^1.0.2",
"ng2-currency-mask": "^9.0.2",
"ng2-dragula": "^1.5.0",
"ng2-file-upload": "^1.4.0",
"ng2-google-charts": "^6.1.0",
"ng2-nouislider": "^1.8.3",
"ng2-toasty": "^4.0.3",
"ngx-bar-rating": "^1.1.0",
"ngx-chips": "^2.2.2",
"ngx-color-picker": "^9.1.0",
"ngx-custom-validators": "^9.1.0",
"ngx-lightbox": "^2.2.2",
"ngx-perfect-scrollbar": "^8.0.0",
"node-sass": "^4.14.1",
"nouislider": "^14.6.4",
"rxjs": "^6.6.7",
"rxjs-compat": "^6.6.7",
"screenfull": "^5.1.0",
"sweetalert2": "^9.17.2",
"text-mask-addons": "^3.8.0",
"tslib": "^2.1.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular-devkit/architect": "^0.1102.6",
"#angular-devkit/build-angular": "^0.1101.4",
"#angular/cli": "^11.2.6",
"#angular/compiler-cli": "^11.1.2",
"#types/datatables.net": "^1.10.19",
"#types/datatables.net-buttons": "^1.4.5",
"#types/jasmine": "^3.6.9",
"#types/jasminewd2": "~2.0.3",
"#types/jquery": "^3.5.5",
"#types/node": "^12.20.7",
"codelyzer": "^6.0.1",
"firebase-tools": "^9.8.0",
"fuzzy": "^0.1.3",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.2.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"open": "^7.4.2",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "^6.1.3",
"typescript": "4.1.2"
}
}
main.ts
import { enableProdMode } from '#angular/core';
import { platformBrowserDynamic } from '#angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
I'm completely lost now, hoping someone here can see the obvious thing I'm sure I am missing
Check angular and firebase #angular/fire compatibility issues
AngularFire doesn't follow Angular's versioning as Firebase also has breaking changes throughout the year. Instead we try to maintain compatibility with both Firebase and Angular majors for as long as possible, only breaking when we need to support a new major of one or the other.
See here:
https://github.com/angular/angularfire#compatibility

Angular 10 npm error hasBindingPropertyName is not a function

I am getting this error all of sudden in Jenkins build, i tried upgrading to latest Angular that is 10.1 but even after upgrading issue is not resolved. So i rolled back to Angular 10.0, package.json dependencies below
[09/11/2020 03:26:56.420] - Build:: Compiling
#angular/platform-browser-dynamic/testing : es2015 as esm2015
[09/11/2020 03:27:09.120] - Build:: Error: Error on worker #5:
TypeError: dir[ioType].hasBindingPropertyName is not a function
[09/11/2020 03:27:09.120] - Build:: at
Project_folder/node_modules/#angular/compiler/bundles/compiler.umd.js:30061:79
[09/11/2020 03:27:09.120] - Build:: at Array.find ()
[09/11/2020 03:27:09.120] - Build:: at setAttributeBinding
Package.json
"dependencies": {
"#angular-devkit/build-angular": "0.1000.4",
"#angular/animations": "^10.0.7",
"#angular/common": "^10.0.7",
"#angular/compiler": "^10.0.7",
"#angular/core": "^10.0.7",
"#angular/forms": "^10.0.7",
"#angular/platform-browser": "^10.0.7",
"#angular/platform-browser-dynamic": "^10.0.7",
"#angular/router": "^10.0.7",
"#ng-idle/core": "^8.0.0-beta.4",
"#ng-idle/keepalive": "^8.0.0-beta.4",
"#nguniversal/express-engine": "^9.1.1",
"#nguniversal/module-map-ngfactory-loader": "^8.1.1",
"async-exit-hook": "^2.0.1",
"body-parser": "^1.18.3",
"cfenv": "^1.2.2",
"classlist.js": "^1.1.20150312",
"core-js": "^3.0.0",
"crypto-js": "3.1.9-1",
"d3": "^5.9.2",
"dotenv": "^8.1.0",
"eureka-js-client": "^4.4.2",
"file-saver": "^2.0.1",
"google-maps": "^4.3.2",
"healthcheck-ping": "^2.0.1",
"hystrixjs": "^0.2.0",
"jsnlog": "^2.29.0",
"json-logic-js": "^1.2.2",
"jsrsasign": "^8.0.20",
"memory-cache": "^0.2.0",
"morgan": "^1.9.1",
"ng2-cookies": "^1.0.12",
"ng2-slimscroll": "^2.0.1",
"ngx-ui-loader": "^9.1.1",
"ngx-webstorage": "^5.0.0",
"node-fetch": "^2.3.0",
"preboot": "^7.0.0",
"reflect-metadata": "^0.1.13",
"source-map-support": "^0.5.11",
"string-to-json": "^0.1.0",
"text-mask-addons": "^3.8.0",
"tslib": "^2.0.0",
"web-animations-js": "^2.3.2",
"weighted-round-robin": "^2.0.2",
"zone.js": "~0.10.3"
},
"devDependencies": {
"#angular/cli": "^10.0.4",
"#angular/compiler-cli": "^10.0.7",
"#angular/language-service": "^10.0.7",
"#types/express": "^4.17.7",
"#types/google-maps": "^3.2.2",
"#types/jasmine": "^3.5.11",
"#types/jasminewd2": "^2.0.6",
"#types/node": "^14.0.23",
"#types/node-fetch": "^2.5.5",
"browserstack-local": "^1.3.7",
"codelyzer": "^6.0.0",
"cpx": "^1.5.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^10.0.0",
"npm-run-all": "^4.1.5",
"protractor": "~7.0.0",
"rimraf": "^3.0.0",
"ts-loader": "^7.0.5",
"ts-node": "^8.10.2",
"tslint": "~6.1.0",
"typescript": "3.9.7",
"webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.3.12",
"webpack-node-externals": "^1.7.2"
}
It seems there is an issue in #angular/compiler 10.1.1.
This isn't a solution for that problem, but I was able to workaround the issue by downgrading both #angular/compiler and #angular/compile-cli to 10.0. An update to package.json alone wasn't sufficient. I also needed to clean up node_modules to revert the code.
The steps I took that resulted in a successful build...
Update package.json
"dependencies": {
...
"#angular/compiler": "~10.0.3",
...
},
"devDependencies": {
...
"#angular/compiler-cli": "~10.0.3",
...
}
Note the tilde (~) instead of caret (^) above so that npm doesn't automatically give you 10.1.1.
rm -rf node_modules
npm update && ng build --prod
Sometimes it occurs due to extra or less closing tag in HTML.
Check your latest changes in html template file.

Vue and Vue-template-compiler version > "2.1.4" gives error in browser

Everything was fine and dandy. Then I upgraded Vue and Vue-template-compiler npm packages to versions for both above 2.1.4 and then nothing shows in my browser except following error:
(unknown) [Vue warn]: Error when rendering root instance: warn
localhost/:2961 Uncaught ReferenceError: _h is not defined
at Proxy.render (eval at <anonymous> (http://localhost:8080/js/app.js:1509:1), <anonymous>:1096:14)
at Vue$2.Vue._render (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:2952:22)
at Vue$2.eval (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:2189:21)
at Watcher.get (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:1652:27)
at new Watcher (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:1644:12)
at Vue$2.Vue._mount (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:2188:19)
at Vue$2.$mount (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:5978:15)
at install$2 (eval at <anonymous> (http://localhost:8080/js/app.js:1509:1), <anonymous>:1223:29)
at Object.install$$1 [as install] (eval at <anonymous> (http://localhost:8080/js/app.js:1509:1), <anonymous>:6265:3)
at Function.Vue.use (eval at <anonymous> (http://localhost:8080/js/app.js:794:1), <anonymous>:3364:22)
My package.json:
{
"name": "myapp",
"version": "0.0.1",
},
"dependencies": {
"babel-runtime": "^6.20.0",
"fastclick": "^1.0.6",
"material-design-icons": "^3.0.1",
"moment": "^2.17.1",
"quasar-framework": "^0.9.1",
"roboto-fontface": "^0.6.0",
"velocity-animate": "^1.3.1",
"vue": "2.1.4",
"vue-router": "^2.1.1"
},
"devDependencies": {
"autoprefixer": "^6.5.3",
"babel-core": "^6.20.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.9",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-2": "^6.18.0",
"colors": "^1.1.2",
"connect-history-api-fallback": "^1.3.0",
"css-loader": "^0.26.1",
"eslint": "^3.11.1",
"eslint-config-standard": "^6.2.1",
"eslint-friendly-formatter": "^2.0.6",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^1.7.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^2.0.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.0",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.9.0",
"function-bind": "^1.1.0",
"html-webpack-plugin": "^2.24.1",
"http-proxy-middleware": "^0.17.3",
"json-loader": "^0.5.4",
"postcss-loader": "^1.2.0",
"stylus": "^0.54.5",
"stylus-loader": "^2.4.0",
"url-loader": "^0.5.7",
"vue-loader": "^10.0.2",
"vue-html-loader": "^1.2.3",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "2.1.4",
"chai": "^3.5.0",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-sinon-chai": "^1.2.4",
"karma-spec-reporter": "^0.0.26",
"karma-webpack": "^1.8.0",
"karma-chrome-launcher": "^2.0.0",
"karma-firefox-launcher": "^1.0.0",
"karma-ie-launcher": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.1",
"karma-safari-launcher": "^1.0.0",
"karma-sauce-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"phantomjs-prebuilt": "^2.1.13",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"lolex": "^1.5.2",
"mocha": "^3.2.0",
"inject-loader": "^2.0.1",
"isparta-loader": "^2.0.0",
"chromedriver": "^2.25.2",
"cross-spawn": "^4.0.2",
"nightwatch": "^0.9.9",
"selenium-server": "^2.53.1",
"semver": "^5.3.0",
"opn": "^4.0.2",
"ora": "^0.3.0",
"shelljs": "^0.7.4",
"webpack": "^2.1.0-beta.27",
"webpack-dev-middleware": "^1.8.4",
"webpack-hot-middleware": "^2.13.2",
"webpack-merge": "^0.18.0"
}
}
going back for both to version 2.1.4 and everything is fine again... How can I succesfully update Vue and Vue-template-compiler?
There has been a renaming of a method in vue:
https://github.com/vuejs/vue/commit/4b51ad048306367a6fb6fbee7445e086d855f31e
Your code or your dependencies might still use _h. In my case it relates to Quasar Framework. After updating to Quasar Framework 10.3 and vue 2.1.6 with vue-template-compiler 2.1.6 it is solved. See:
https://github.com/quasarframework/app-template-default/issues/5
Browsing through github searching on _h and vue brought me there.
It seems like same issue, as has been raised here. You should upgrade vue-template-compiler to 2.2.0, which should fix it.

react-packager Unexpected token (flow related)

This happens from me from time to time. After a cache clean up "suddenly" react-native stops working without a seemingly clear reason.
/Users/Shared/projects/project/node_modules/react-native/packager/react-packager/src/Logger/index.js:85
printFields? = [])
^
SyntaxError: Unexpected token ?
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at loader (/Users/Shared/projects/project/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/Shared/projects/project/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/Shared/projects/project/node_modules/react-native/packager/react-packager/index.js:14:16)
I'm on react-native 0.38.0, node 6.1.0, but also tried switching to node 6.9.2
Tried removing and reinstalling (through yarn) the node_modules folder.
I'm fairly certain that the specific error is irrelevant. What seems to be happening is that flow syntax is not being recognized.
.babelrc
{
"presets": [
"react-native",
"react-native-stage-0",
"react-native-stage-0/decorator-support",
]
}
dev dependencies
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-modules-commonjs": "^6.7.4",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-preset-airbnb": "^2.0.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-preset-react-native": "1.9.1",
"babel-preset-react-native-stage-0": "^1.0.1",
"babel-register": "^6.9.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chai-enzyme": "^0.6.1",
"chai-immutable": "^1.6.0",
"commitizen": "^2.9.2",
"cz-conventional-changelog": "^1.1.6",
"enzyme": "^2.2.0",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-react": "^6.8.0",
"expect.js": "^0.3.1",
"flow": "^0.2.3",
"flow-bin": "^0.37.3",
"immutablediff": "^0.4.3",
"mocha": "^3.0.2",
"react-dom": "^15.3.1",
"react-native-mock": "^0.2.6",
"reactotron-redux": "^1.6.1",
"redux-debounce": "^1.0.1",
"redux-debounced": "^0.3.0",
"redux-devtools": "^3.1.1",
"redux-devtools-dock-monitor": "^1.1.0",
"redux-devtools-log-monitor": "^1.0.5",
"redux-mock-store": "^1.0.2",
"remote-redux-devtools": "^0.5.7",
"sinon": "^1.17.5",
"why-did-you-update": "0.0.8"
Any suggestions?
The simplest answer I have here is: downgrade to Node 5.x.
The longer answer is that it's probably due to a bug in transform-flow-strip-types (not stripping the ?), but is circumvented via the Babel preset es2015-node containing transform-es2015-parameters. BUT, es2015-node only includes the plugins when running in Node <= 5.x.
I've created an issue over at the React Native issues page if you want to follow along: https://github.com/facebook/react-native/issues/11601