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

circular dependency #85

Open
donaldta opened this issue Mar 26, 2021 · 4 comments
Open

circular dependency #85

donaldta opened this issue Mar 26, 2021 · 4 comments

Comments

@donaldta
Copy link

Oddly, I was able to get this running fine without errors a few days ago. However, now I can no longer see any devices connected to the monitor. When starting the app via "npm start" I see the following errors.

Logger config file: "logger-config.json"
Log directory path: "."
Starting discovery on interface: 10.203.40.2
(node:9788) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9788) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:9788) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
Error: connect EHOSTUNREACH 10.203.40.35:9999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -113,
  code: 'EHOSTUNREACH',
  syscall: 'connect',
  address: '10.203.40.35',
  port: 9999
}

I think there could have been some changes in npm/js that caused this. Tried doing an npm update and got the following message, "npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.". And while it updated some software, I still see the same error and symptom.

Unfortunately, I cannot use the pre-packaged binaries since the auto-discovery method does not work for me. I have to hard code the IP in the services/device-manager.js using the hack provided by Peter Robins' (probins) from another issue.

	let devClient = new Client();
	devClient.getDevice({ host: '10.203.40.35' })
	.then(device => registerPlug(device))
	.catch(err => console.log(err));
@donaldta
Copy link
Author

And today, it found the device.

npm start

> tplink-monitor@0.0.1 start
> node ./app.js

Logger config file: "logger-config.json"
Log directory path: "."
Starting discovery on interface: 10.203.40.2
(node:28299) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:28299) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:28299) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
Found device with energy monitor support: Energy Monitor [80060C2B34A68DAF1486576460E83E6A1DE12097]
Logging started for Energy Monitor [80060C2B34A68DAF1486576460E83E6A1DE12097] every 60 seconds
GET / 302 7.380 ms - 126
GET /80060C2B34A68DAF1486576460E83E6A1DE12097 200 52.645 ms - 10208
GET /stylesheets/style.css 304 1.632 ms - -
GET /javascripts/dash.js 304 0.672 ms - -
GET /favicon.ico 200 8.159 ms - 10084

No changes have been done since the last posting. Started it up this morning and to my surprise, it just started working again.

I'm going to leave this issue open in case the original author or someone else decides to address the "Accessing non-existent property {cmd} of module exports inside circular dependency" issues. Perhaps fixing the discovery process or even providing a way of legitimately adding devices manually.

@Xeroxxx
Copy link

Xeroxxx commented Apr 1, 2021

Hey,
you may check out https://github.com/Xeroxxx/tplink-energy-monitor

We improved the current build form james and currently working (dev-v2.0 branch) on a complete remade and improved version.

@DouglasteR
Copy link

Hey,
you may check out https://github.com/Xeroxxx/tplink-energy-monitor

We improved the current build form james and currently working (dev-v2.0 branch) on a complete remade and improved version.

Thanks !

@wkhan69
Copy link

wkhan69 commented Aug 6, 2021

FYI, I had the same problem of circular dependencies, but when I ran the Xeroxxx code, it worked fine.

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

4 participants