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

Mathjs 9.1.0 can't load crypto #2096

Closed
OttawaIan opened this issue Jan 30, 2021 · 7 comments
Closed

Mathjs 9.1.0 can't load crypto #2096

OttawaIan opened this issue Jan 30, 2021 · 7 comments

Comments

@OttawaIan
Copy link

From looking around this issue was supposedly fixed awhile ago but I upgraded from 7.1.0 to 9.1.0 and I am having this issue in my typescript project. Does anyone know how to fix it ?? It seemed like bigdecimal fixed this in version

require.js:143 Uncaught Error: Script error for "crypto", needed by: mathjs/math

The example is a simple node project that displays an html page
import * as mathjs from "mathjs/math";
this.mathjsSqrt = ko.observable(mathjs.sqrt(4));

I am loading mathjs from mathjs/lib/browser folder

@OttawaIan OttawaIan changed the title Mathjs can't load crypto Mathjs 9.1.0 can't load crypto Jan 30, 2021
@josdejong
Copy link
Owner

Thanks for reporting @OttawaIan . How can I reproduce this issue exactly?

I do indeed still see a reference to "crypto" in the bundle script:

mathjs/gulpfile.cjs

Lines 84 to 86 in 5011ed1

externals: [
'crypto' // is referenced by decimal.js
],

It may be a matter of removing this dependency.

@josdejong
Copy link
Owner

I've cleaned up this reference to crypto, not yet published though. This may solve your issue.

@OttawaIan
Copy link
Author

OttawaIan commented Jan 30, 2021 via email

@josdejong
Copy link
Owner

What would help me is knowing how to reproduce your issue. So far it's only a guess from my side.

@josdejong josdejong reopened this Jan 30, 2021
@OttawaIan
Copy link
Author

OttawaIan commented Jan 30, 2021 via email

@josdejong
Copy link
Owner

Awesome! Great to hear that this indeed fixes your issue 👍

@josdejong
Copy link
Owner

The fix is now published in v9.2.0

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