Nativescript: Upgrading zone.js to latest ^0.6.18 doesn't let app build

Created on 10 Sep 2016  路  6Comments  路  Source: NativeScript/NativeScript

tldr;

Revert back to 0.6.17 zone.js


I get this error when trying to build my app:

Sep 10 12:27:29 Robs-MBP client[10264]: 3   0x10b85392d start
Sep 10 12:27:29 Robs-MBP client[10264]: **file:///app/tns_modules/zone.js/dist/zone-node.js:670:21: JS ERROR Error: Could not find module 'timers'**. Computed path '/Users/roblav96/Library/Developer/CoreSimulator/Devices/F0820311-799D-4113-AE34-3C3AAD669E9F/data/Containers/Bundle/Application/B5D1EF38-393A-4AA2-B204-C03023FC42D6/client.app/app/tns_modules/timers'.
Sep 10 12:27:29 Robs-MBP com.apple.CoreSimulator.SimDevice.F0820311-799D-4113-AE34-3C3AAD669E9F.launchd_sim[2436] (UIKitApplication:com.roblav96.sandbox[0x4bbd][10264]): Service exited due to signal: Segmentation fault: 11

Checking npm info zone.js:

     '0.6.16': '2016-08-22T17:29:49.463Z',
     '0.6.17': '2016-08-22T22:41:52.196Z',
     '0.6.18': '2016-09-10T16:04:53.468Z',
     '0.6.19': '2016-09-10T16:06:17.234Z' },

I revert back to 0.6.17 and everything works fine again.

Most helpful comment

ditto.. I'm not sure whether the zone.js team would necessarily care about code changes that would break compatibility with NativeScript, but I added an issue in their repo that describes the problem and its origin.

In the meanwhile, we're stuck with either:

  • reverting our version of zone.js (as suggested here) to a known/working copy
  • write a (temporary?) workaround that exposes a module "timers", which simply wraps the existing module "timer"

All 6 comments

ditto.. I'm not sure whether the zone.js team would necessarily care about code changes that would break compatibility with NativeScript, but I added an issue in their repo that describes the problem and its origin.

In the meanwhile, we're stuck with either:

  • reverting our version of zone.js (as suggested here) to a known/working copy
  • write a (temporary?) workaround that exposes a module "timers", which simply wraps the existing module "timer"

This looks related to nativescript-angular issue #144

tldr;

  • quick example that summarizes the process to revert the version of zone.js in a NativeScript project
  • tested (this time)
tns create ExampleProject --ng
cd ExampleProject

# revert version of "zone.js" in "nativescript-angular":
cd node_modules/nativescript-angular
npm uninstall zone.js --save
npm install [email protected] --save

# revert version of "zone.js" in "ExampleProject":
# (note: its "package.json" doesn't list this module, so it must be listed under "peerDependencies" in one of the listed "dependencies".. didn't bother to track it down)
cd ../..
npm uninstall zone.js
npm install [email protected]

# remove "tns_modules" (if they already exist):
rm -rf platforms

# add "android" as a target plaform (if it isn't already):
tns platform add android

# rebuild and do a test run:
tns run android

update: I was curious.. and learned something new..

the module: @angular/core is a "scoped package"

it's "package.json" includes "zone.js" in its "peerDependencies".

when npm installs @angular/core, the peer is added adjacent to the parent "scope" (ie: as a peer to @angular), which is the 2nd instance of "zone.js" reverted in the above example.

related to issue #444 .
Please comment in issue #444 .

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings