Skip to content

Error when updating .css files when using livesync #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sebawita opened this issue Feb 17, 2016 · 1 comment
Closed

Error when updating .css files when using livesync #76

sebawita opened this issue Feb 17, 2016 · 1 comment

Comments

@sebawita
Copy link
Contributor

When I use livesync and make a change to a .css (i.e. app.css) I get an error (see below).
When I edit a ts or html file, the error disappears and the css change is applied correctly.

I am using {N} 1.6.0
You can replicate the issue with: sample-groceries angular branch
project.

Executing before-prepare hook from /Users/witalec/NS/Workshop/sample-Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Project successfully prepared
Transferring project files...
Successfully transferred all project files.
Applying changes...
Successfully synced application org.nativescript.groceries on device 192.168.57.101:5555.
JS: Page loaded
JS: BOOTSTRAPPING...
JS: ROOT
JS: CREATE VIEW ROOT: Page
JS: NativeScriptRenderer.createElement: StackLayout parent: Page(1), Page
JS: NativeScriptRenderer.createElement: page-router-outlet parent: StackLayout(25), StackLayout
JS: Creating view container in:StackLayout(25)
JS: EXCEPTION: Error during instantiation of Router! (PageRouterOutlet -> Router).
JS: ORIGINAL EXCEPTION: Route config should contain exactly one "as" or "name" property.
JS: ORIGINAL STACKTRACE:
JS: Error: Route config should contain exactly one "as" or "name" property.
JS:     at new BaseException (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/facade/exceptions.js:15:23)
JS:     at Object.normalizeRouteConfig (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_config_nomalizer.js:29:15)
JS:     at RouteRegistry.config (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:66:43)
JS:     at /data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:108:72
JS:     at Array.forEach (native)
JS:     at RouteRegistry.configFromComponent (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:108:31)
JS:     at new RootRouter (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/router.js:423:23)
JS:     at routerFactory (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/router_providers_common.js:23:22)
JS:     at Injector._instantiate (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/injector.js:766:27)
JS:     at Injector._instantiateProvider (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/injector.js:714:25)
JS: ERROR CONTEXT:
JS: [object Object]
JS: ERROR BOOTSTRAPPING ANGULAR
JS: EXCEPTION: Error during instantiation of Router! (PageRouterOutlet -> Router).
JS: ORIGINAL EXCEPTION: Route config should contain exactly one "as" or "name" property.
JS: ORIGINAL STACKTRACE:
JS: Error: Route config should contain exactly one "as" or "name" property.
JS:     at new BaseException (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/facade/exceptions.js:15:23)
JS:     at Object.normalizeRouteConfig (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_config_nomalizer.js:29:15)
JS:     at RouteRegistry.config (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:66:43)
JS:     at /data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:108:72
JS:     at Array.forEach (native)
JS:     at RouteRegistry.configFromComponent (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/route_registry.js:108:31)
JS:     at new RootRouter (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/router.js:423:23)
JS:     at routerFactory (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/router/router_providers_common.js:23:22)
JS:     at Injector._instantiate (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/injector.js:766:27)
JS:     at Injector._instantiateProvider (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/injector.js:714:25)
JS: ERROR CONTEXT:
JS: [object Object]
JS: 
JS: undefined
@hdeshev
Copy link
Contributor

hdeshev commented Feb 19, 2016

Page reloads triggered by CSS changes are not supported. I added a clumsy hack for the Groceries sample, but the real fix has to come from nativescript-cli.

Logged as NativeScript/nativescript-cli#1517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants