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

Cannot set property 'startDialog' of undefined #4

Closed
svict4 opened this issue Nov 22, 2015 · 6 comments
Closed

Cannot set property 'startDialog' of undefined #4

svict4 opened this issue Nov 22, 2015 · 6 comments

Comments

@svict4
Copy link

svict4 commented Nov 22, 2015

hubot> [Sun Nov 22 2015 10:22:11 GMT+1000 (E. Australia Standard Time)] ERROR Error loading scripts from npm package -
 TypeError: Cannot set property 'startDialog' of undefined
  at Conversation (C:\Users\Simon\Documents\hubot\node_modules\hubot-conversation\lib\index.js:36:22)
  at Robot.loadExternalScripts (C:\Users\Simon\Documents\hubot\node_modules\hubot\src\robot.coffee:399:11)
  at C:\Users\Simon\Documents\hubot\node_modules\hubot\bin\hubot:128:26
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

The line in question:

this.startDialog = function startDialog(msg, timeout) {

I guess you're invoking this incorrectly? Might just be me being silly.

@lmarkus
Copy link
Owner

lmarkus commented Nov 22, 2015

Any chance you're not using the "new" keyword when instantiating a Conversation?
eg:

var conversation = new Conversation(robot)

Take a look at the unit tests. npm test should be passing for all of them.

@svict4
Copy link
Author

svict4 commented Nov 22, 2015

Hmm I removed all of the scripts I had and simply npm installed, giving the above error.
I think there's a clash with another package which I'm investigating now.

You're right though npm test passes and it works fine for a completely new hubot repo.

@svict4 svict4 closed this as completed Nov 22, 2015
@svict4
Copy link
Author

svict4 commented Nov 23, 2015

Welp, I was being dumbdumb and adding "hubot-conversation" to external-scripts.json when it was not needed. Crisis averted.

@lmarkus
Copy link
Owner

lmarkus commented Nov 23, 2015

¯_(ツ)_/¯

@rihlsul
Copy link

rihlsul commented Feb 2, 2016

Just FYI, I ran into this also, might be worthy of a reminder to NOT do that towards the top of README.md. Just to help us out when we're not thinking. :)

@lmarkus
Copy link
Owner

lmarkus commented Feb 25, 2016

Done :)

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

3 participants