Skip to content
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

Possible issue with usage of config-file? #9

Open
philfreo opened this issue Dec 27, 2016 · 1 comment
Open

Possible issue with usage of config-file? #9

philfreo opened this issue Dec 27, 2016 · 1 comment

Comments

@philfreo
Copy link
Contributor

philfreo commented Dec 27, 2016

When trying to setup homebridge & homebridge-wink, I ran into an issue (on node 7.3.0) that's both described & fixed by @tekuonline in KraigM/homebridge-wink#67, which is basically just a fork of your wink-js but cutting out the config-file dependency.

Hoping we can confirm exactly where the issue is so we can get a proper fix. Let me know if I can help.

/cc @KraigM @tekuonline @jonschlinkert

@scoobyshi
Copy link
Contributor

scoobyshi commented Jan 3, 2017

I believe the reason for the issue in Node v5+ is because wink-js is specifying config-file as a dependency, version 0.1.8. Later versions of config-file (3.0) apparently changed the function calls, so you could no longer use .load (which is invoked in wink-js's index.js), but had to use .parse or another option, depending on what you needed to do.

Regardless, the underlying issue is that in config-file 0.1.8 it makes a call on line 17 to path.dirname (https://github.com/jonschlinkert/config-file/blob/2743b333bf8b24bcd148e0276ab31b1ff67f46d9/index.js), and in earlier versions of Node (like 4.7.0) there was not type check on the call to dirname (see https://nodejs.org/docs/latest-v4.x/doc/api/path.html#path_path_dirname_p), so it wouldn't throw an error if this was null, however in later versions of Node, you'll find there is a type check: https://nodejs.org/api/path.html#path_path_dirname_path, "A TypeError is thrown if path is not a string.".

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