Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

TypeError: cannot read property "join" of undefined #1

Open
markasoftware opened this issue Feb 6, 2017 · 5 comments
Open

TypeError: cannot read property "join" of undefined #1

markasoftware opened this issue Feb 6, 2017 · 5 comments
Assignees
Labels

Comments

@markasoftware
Copy link

Installed with npm i -g swmpjs, and run with swmpjs on Arch with node 7.5.0. I get this error displayed in the console and the browser when visiting 127.0.0.1:8000:

TypeError: Cannot read property 'join' of undefined
   at getTitle (/usr/lib/node_modules/swmpjs/index.js:28:45)
   at /usr/lib/node_modules/swmpjs/index.js:59:10
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at /usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:271:10)
   at logger (/usr/lib/node_modules/swmpjs/node_modules/morgan/index.js:144:5)
@Efreak Efreak closed this as completed in 2c553dd Feb 7, 2017
@Efreak
Copy link
Owner

Efreak commented Feb 7, 2017

Pushed to npm, try reinstalling.

@markasoftware
Copy link
Author

I am still getting the same issue:

TypeError: Cannot read property 'join' of undefined
   at getTitle (/usr/lib/node_modules/swmpjs/index.js:28:45)
   at /usr/lib/node_modules/swmpjs/index.js:60:10
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at /usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:271:10)
   at logger (/usr/lib/node_modules/swmpjs/node_modules/morgan/index.js:144:5)

with 1.2.3 from npm (the new one). I can also confirm it occurs on my Debian machine too.

@markasoftware
Copy link
Author

When i specify the interface on the command line, like this: swmpjs --interface enp5s0 I get a different error instead:

Error: Failed to lookup view "index.ejs" in views directory "/home/markasoftware/views"
   at Function.render (/usr/lib/node_modules/swmpjs/node_modules/express/lib/application.js:579:17)
   at ServerResponse.render (/usr/lib/node_modules/swmpjs/node_modules/express/lib/response.js:960:7)
   at /usr/lib/node_modules/swmpjs/index.js:67:6
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/layer.js:95:5)
   at /usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/lib/node_modules/swmpjs/node_modules/express/lib/router/index.js:271:10)

Not completely sure why it's looking in my home directory...when I install locally (npm i swmpjs instead of npm i -g swmpjs) it looks in the installation directory instead, not node_modules/swpmjs inside of it.

@markasoftware
Copy link
Author

markasoftware commented Feb 8, 2017

Was able to get it working by cding into the node_modules/swmpjs folder then launching with node index.js --interface enp5s0, it appears to look for stuff in the pwd, which is bad. There are more issues after installation, however, namely the cpu usage percentage is over 100% because I have multiple cores, which glitches it out.

@Efreak
Copy link
Owner

Efreak commented Feb 12, 2017

That's odd. This should have been fixed by c36a8d4. If you install from git instead of npm, does that work? (npm uninstall -g swmpjs && npm install -g efreak/swmpjs)

@Efreak Efreak reopened this Feb 12, 2017
@Efreak Efreak self-assigned this Feb 12, 2017
@Efreak Efreak added the bug label Feb 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants