Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

TypeError: this.route.ws is not a function #42

Closed
gferreri opened this issue Mar 2, 2018 · 7 comments
Closed

TypeError: this.route.ws is not a function #42

gferreri opened this issue Mar 2, 2018 · 7 comments
Projects

Comments

@gferreri
Copy link

gferreri commented Mar 2, 2018

When calling ooth.start I see the error

TypeError: this.route.ws is not a function
at Ooth.start (/Users/gsferrer/Projects/myProject/node_modules/ooth/lib/index.js:211:24)

Looking at the source, it appears that expressws(app) is called in start() after the router has been created in the Ooth constructor.

From the express-ws README:

Important: Make sure to set up the express-ws module like above before loading or defining your routers! Otherwise, express-ws won't get a chance to set up support for Express routers, and you might run into an error along the lines of router.ws is not a function.

@aaronmgdr
Copy link
Contributor

ah so its not just me

@ghost
Copy link

ghost commented Mar 5, 2018

same her

@nickredmark
Copy link
Owner

Thanks for the report, I'll give it a look tomorrow.

@aaronmgdr
Copy link
Contributor

thanks!

@nickredmark
Copy link
Owner

Hello everyone, sorry for the delay. It would help me to know the difference between your setup and this example which works for me without error: https://github.com/nmaro/ooth/blob/master/examples/standalone/ooth/index.js

@nickredmark nickredmark added this to Backlog in Ooth Mar 16, 2018
@nickredmark nickredmark moved this from Backlog to Prioritized in Ooth Mar 16, 2018
@gferreri
Copy link
Author

So I no longer see this error, and I'm not 100% sure what I did to fix it :-/. I believe it had something to do with the order of calls to express.use in my app. The standalone example works fine for me as well.

@nickredmark
Copy link
Owner

Assuming it's not a bug, otherwise leave a comment.

@nickredmark nickredmark moved this from Prioritized to Done April 2018 in Ooth Apr 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Ooth
Done April 2018
Development

No branches or pull requests

3 participants