question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tns livesync ios error on before-watch hook

See original GitHub issue

Hi I’m following the Building Apps with NativeScript and Angular 2 to build the groceries app. It works fine when I run tns run ios --emulator or tns livesync ios --emulator, but if I want to watch my files, doesn’t work at al… Is that any way to reload without watch?

I’m trying to run the follow command: tns livesync ios --emulator --watch

Here’s the error that happens on before-watch hook which is basically a require to the file nativescript-dev-typescript/lib/watch.js

I’ve runned a trace and the log is on pastebin. I post here the main errors:

Errors

BeforeHookName for command watch is before-watch
Executing before-watch hook from /Users/lcaseiro/Sites/native-script-groceries/hooks/before-watch/nativescript-dev-typescript.js
Executing before-watch hook at location /Users/lcaseiro/Sites/native-script-groceries/hooks/before-watch/nativescript-dev-typescript.js in-process
Found peer TypeScript 1.8.10
Hook promises to signal completion
fs.js:1315
    throw error;
    ^

Error: watch /users/lcaseiro/sites/native-script-groceries ENOENT
    at exports._errnoException (util.js:856:11)
    at FSWatcher.start (fs.js:1313:19)
    at Object.fs.watch (fs.js:1341:11)
    at addDirWatcher (/Users/lcaseiro/Sites/native-script-groceries/node_modules/typescript/lib/tsc.js:1036:39)
    at Object.addFile (/Users/lcaseiro/Sites/native-script-groceries/node_modules/typescript/lib/tsc.js:1051:21)
    at Object.watchFile (/Users/lcaseiro/Sites/native-script-groceries/node_modules/typescript/lib/tsc.js:1172:48)
    at Object.executeCommandLine (/Users/lcaseiro/Sites/native-script-groceries/node_modules/typescript/lib/tsc.js:34546:44)
    at Object.<anonymous> (/Users/lcaseiro/Sites/native-script-groceries/node_modules/typescript/lib/tsc.js:34877:4)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)

Failed during hook execution.
TypeScript compiler failed with exit code 1

tns version: 1.7.1

OSX El Capitan: 10.11.3

npm 3.8.6

Node 5.4.0

npm packages:

β”œβ”€β”€ angular2@2.0.0-beta.9
β”œβ”€β”€ es6-promise@3.1.2 extraneous
β”œβ”€β”€ es6-shim@0.33.13 extraneous
β”œβ”€β”¬ nativescript-angular@0.0.38
β”‚ └── es6-shim@0.33.13
β”œβ”€β”¬ nativescript-dev-typescript@0.3.1
β”‚ └─┬ nativescript-hook@0.2.1
β”‚   β”œβ”€β”¬ glob@6.0.4
β”‚   β”‚ β”œβ”€β”¬ inflight@1.0.4
β”‚   β”‚ β”‚ └── wrappy@1.0.1
β”‚   β”‚ β”œβ”€β”€ inherits@2.0.1
β”‚   β”‚ β”œβ”€β”¬ minimatch@3.0.0
β”‚   β”‚ β”‚ └─┬ brace-expansion@1.1.3
β”‚   β”‚ β”‚   β”œβ”€β”€ balanced-match@0.3.0
β”‚   β”‚ β”‚   └── concat-map@0.0.1
β”‚   β”‚ β”œβ”€β”¬ once@1.3.3
β”‚   β”‚ β”‚ └── wrappy@1.0.1
β”‚   β”‚ └── path-is-absolute@1.0.0
β”‚   └─┬ mkdirp@0.5.1
β”‚     └── minimist@0.0.8
β”œβ”€β”€ parse5@1.4.2
β”œβ”€β”€ punycode@1.3.2
β”œβ”€β”€ querystring@0.2.0
β”œβ”€β”€ reflect-metadata@0.1.2
β”œβ”€β”€ rxjs@5.0.0-beta.2
β”œβ”€β”€ shelljs@0.5.3
β”œβ”€β”¬ tns-core-modules@2.0.0-angular-4
β”‚ └── tns-core-modules-widgets@1.7.0
β”œβ”€β”€ typescript@1.8.10
β”œβ”€β”€ url@0.10.3
└─┬ zone.js@0.5.15
  └── es6-promise@3.1.2

gcc --version

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rosen-vladimirovcommented, Apr 21, 2016

Hi @leocaseiro , This issue is addressed in our release branch and it will be included in the 2.0.0 official release. You can find more information here and here

0reactions
leocaseirocommented, May 31, 2016

The bug is with TypeScript, not NativeScript.

TypeScript has made some changes with case-sensitive and the solution @cmoffatt found it to Downgrade to TypeScript@1.7.5, you can read more here:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nativescript Angular2 tutorial results in error - Stack Overflow
'tns livesync ios --emulator --watch Executing before-prepare hook from /Users//Documents/frontend/sample-Groceries/hooks/before-prepare/nativescript-dev-Β ...
Read more >
a problem occurred configuring project ':expo-modules-core'.
2 Executing before-watch hook from C:\Users\Luke\Documents\MobileProjects\HelloWorld\hooks\before-watch\nativescript-dev-webpack.js Copying template files…
Read more >
NativeScript sqlite - OSCHINA - δΈ­ζ–‡εΌ€ζΊζŠ€ζœ―δΊ€ζ΅η€ΎεŒΊ
18th July 2020 # # tns preview # or tns run ios # or tns run android ... before preparing your project before-watch...
Read more >
CLI Basics - NativeScript Docs
Overall, the NativeScript CLI's livesync process makes native iOS and Android ... If you get an error at this point you likely haven't...
Read more >
How to add a TreeView inside DropDownList
Error while executing gradle -v: Command failed: gradle -v ... before-watch hook from C:\tns\TestAppF\hooks\before-watch\nativescript-dev-typescript.js
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found