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

Uncaught ReferenceError: pikadayResponsive is not defined #15

Open
ghost opened this issue Oct 31, 2016 · 1 comment
Open

Uncaught ReferenceError: pikadayResponsive is not defined #15

ghost opened this issue Oct 31, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 31, 2016

I am receiving the following error when trying to use your plugin:

Uncaught ReferenceError: pikadayResponsive is not defined

I have ensured that the library is properly loaded, as well as all dependencies.

I have used bower_components/pikaday-responsive/dist/pikaday-package.js, as well as the individual packages from Pikaday, moment, etc. Nothing seems to get this plugin to work.

Here is what I'm currently importing, which doesn't seem to register a global pickadayResponsive object on the window.

  app.import('bower_components/pikaday-responsive/dist/dependencies/pikaday-responsive-modernizr.js');
  app.import('bower_components/pikaday-responsive/dist/dependencies/pikaday.css');
  app.import('bower_components/pikaday-responsive/dist/pikaday-responsive.css');
  app.import('bower_components/pikaday-responsive/dist/dependencies/pikaday.min.js');
  app.import('bower_components/pikaday-responsive/dist/pikaday-responsive.min.js');

Any thoughts? I can get Pikaday to work on it's own, just not with this plugin.

@mydea
Copy link
Owner

mydea commented Nov 2, 2016

Is this an Ember app? I'm not sure, but you might want to import pikadayResponsive as a module like this:

app.import('bower_components/pikaday-responsive/dist/pikaday-responsive.js', {
  exports: {
    'pikaday-responsive': [
      'default'
    ]
  }
});

And then use it in your app with an es6-import:

import pikadayResponsive from 'pikaday-responsive';
// ...

Haven't tried that myself, but I think that should work.

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

1 participant