Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-34] androidlib v2- "TypeError: _nodeAppc2.default.detect.Watcher is not a function" is thrown if you call androidlib.watch()

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionInvalid
Resolution Date2017-06-19T15:47:34.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsandroidlib
Labelsn/a
ReporterWilson Luu
AssigneeChris Barber
Created2016-08-30T23:32:31.000+0000
Updated2017-06-19T15:47:34.000+0000

Description

*Details:* TypeError: _nodeAppc2.default.detect.Watcher is not a function is thrown if you call androidlib.watch(). *Note:* This occurs on both Windows and Mac. *Steps to reproduce:*

Make sure you are using Node 4.X.X

Clone and run npm install on https://github.com/appcelerator/androidlib/tree/v2; make sure it's v2 branch

Symlink to the above built androidlib v2

Run this Node script:

'use strict';

// NOTE: currently, symlinked node_modules/androidlib folder to a built local copy of https://github.com/appcelerator/androidlib/tree/v2
const androidlib = require('androidlib').androidlib;

androidlib
    .watch()
    .on('results', results => {
        console.log(JSON.stringify(results, null, 4));
    })
    .on('error', err => {
        console.log(err.stack);
    });
*Actual:* A TypeError is thrown:
~/github/libautomator$ node test.js

/Users/wilson_san/github/androidlib/dist/index.js:84
	const handle = new appc.detect.Watcher;
                ^
TypeError: _nodeAppc2.default.detect.Watcher is not a function
    at Object.watch (/Users/wilson_san/github/androidlib/dist/index.js:84:17)
    at Object.<anonymous> (/Users/wilson_san/github/libautomator/test.js:7:6)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3
*Expected:* No TypeError should be thrown.

Comments

  1. Chris Barber 2017-06-19

    Watcher logic has been moved out of node-appc and androidlib and into appcd-fswatcher.

JSON Source