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 TypeError: Cannot read property 'prototype' of undefined #295

Closed
tlaak opened this issue May 9, 2016 · 4 comments
Closed

Uncaught TypeError: Cannot read property 'prototype' of undefined #295

tlaak opened this issue May 9, 2016 · 4 comments
Labels

Comments

@tlaak
Copy link

tlaak commented May 9, 2016

I'm trying to include the jQuery plugin in my code using ES6 modules, but URI in the plugin itself is undefined, thus the error on line 155 in jquery.URI.js. I'm using npm to install dependencies and the installed version is 1.18.

This is how I'm importing it in my code as I need both URI and the jQuery selectors.

import URI from 'urijs';
import 'urijs/src/jquery.URI';

Am I doing something wrong here?

@rodneyrehm
Copy link
Member

I'm not sure how you resolve packages, so I can't say why this isn't working.

@tlaak
Copy link
Author

tlaak commented May 17, 2016

In jquery.URI.js on line 19 there's module.exports = factory(require('jquery', './URI')); which is causing this issue.

It should probably be module.exports = factory(require('jquery'), require('./URI'));

@rodneyrehm
Copy link
Member

wah! thanks for finding this. fixed in master.

@tlaak
Copy link
Author

tlaak commented May 17, 2016

Wow that was fast! Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants