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

Asynchronous Module Definition returns undefined #199

Open
esfoden opened this issue Nov 8, 2019 · 1 comment
Open

Asynchronous Module Definition returns undefined #199

esfoden opened this issue Nov 8, 2019 · 1 comment

Comments

@esfoden
Copy link
Contributor

esfoden commented Nov 8, 2019

hi all, I love the BigInteger library, its fast and the BigInt polyfill mechanism is very useful.

Unfortunately it doesn't seem to work with AMD modules. Using require.js v 2.3.6:

requirejs(["./node_modules/big-integer/BigInteger"], function (big) {

the returned "big" variable is undefined. The problem seems to be at line 1450 of BigInteger.js:

define("big-integer", [], function () {

there are two problems here. Firstly it is the user of the module that names it (I named it "big" above) not the module itself and secondly "big-integer" is not a valid javascript identifier.

The solution is easy: change 1450 to:

define( function () {

and it all works beautifully. I thought I would post the issue here for verification and discussion before submitting a pull request.

@peterolson
Copy link
Owner

Thanks, feel free to submit a pull request.

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

2 participants