Skip to content

Conversation

@blag
Copy link
Contributor

@blag blag commented Aug 2, 2019

Hubot loads all modules in src/, which includes stackstorm_api.js.

This means that the StackStorm class gets initialized without a new keyword, which means that its this variable is undefined, so this line:

  self.robot = robot;

causes an error later on TypeError: Cannot read property 'robot' of undefined.

Moving the stackstorm_api.js module into src/lib/ avoids this situation.

The stackstorm.js module properly initializes the StackStorm class with the new keyword, so it stays.

Imports are updated to reflect the moved module.

@blag blag requested a review from arm4b August 2, 2019 23:22
This was referenced Aug 3, 2019
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

The only missing CHANGELOG record for this fix. Please don't forget to include it.

@arm4b arm4b added the bug label Aug 3, 2019
@blag
Copy link
Contributor Author

blag commented Aug 5, 2019

Yep, I'll add a few lines to the changelog when I make a release.

@blag blag merged commit a1f8620 into master Aug 5, 2019
@blag blag deleted the fix-scripts-loading branch August 5, 2019 15:48
@arm4b
Copy link
Member

arm4b commented Aug 5, 2019

Changelog should come with a change you're doing to be tightly coupled with PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants