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 find Widget of Undefined #5

Open
wirsingj opened this issue Jan 21, 2016 · 6 comments
Open

Cannot find Widget of Undefined #5

wirsingj opened this issue Jan 21, 2016 · 6 comments

Comments

@wirsingj
Copy link

I am trying to get the widgets working- I have both Chimp and chimp-widgets installed globally... my widget file looks like:

module.exports = function(){
    this.Before(function(done){
        this.SearchPage = this.widgets.Widget.extend({
            selector: '#searchform',
            searchFor: function(query){
              this.setValue('input[name="q"]', searchTerm);
              this.keys(['Enter']);
            }

        });
        this.SearchPage.url = 'www.google.com';
        done();
    });
};

When I run chimp I get the error:

TypeError: Cannot read property 'Widget' of undefined
  at World.<anonymous> (features/support/widgets.js:3:39)
@samhatoum
Copy link
Member

I just pushed 0.3.0 - try with that then let us know

@wirsingj
Copy link
Author

I installed it again through NPM, both globally and locally, and still no luck.

I'm not really sure of how Chimp is interacting with chimp-widgets, but seems like it cannot find it.

@tikolakin
Copy link
Contributor

Hi @samhatoum , I have experienced the same issue on 0.3.0

@LewisW
Copy link
Contributor

LewisW commented Jan 26, 2016

I believe the latest version of chimp.js assigns the variable to this.chimpWidgets as you can see here.

The chimp widgets documentation is a bit out of date, I'll update it to add a migration guide to the latest chimp.js changes and the move over to asynchronous.

@leabaertschi
Copy link

leabaertschi commented Jan 13, 2017

I'm having the same issue. I checked the line that you mentioned @LewisW, the thing is that global.chimpWidgets is undefined at runtime. Any idea why? I'm using chimp-widgets version 0.3.0 and chimp version 0.44.0
For a quick fix just add the following line to your World function:
this.chimpWidgets = require('chimp-widgets');

@joscha
Copy link

joscha commented Jul 19, 2017

I think xolvio/chimp#333 might be the reason

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

6 participants