-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Math.js blocks React Native production bundling #797
Comments
Thanks for your detailed description problem description Jon. This sounds like a really easy fix :). I've upgraded the version of decimal.js in the |
Brilliant! Thanks so much Jos for your super fast resolve. |
I'm not always that fast but I'm trying my best :) I've just released math.js v3.9.3 containing the updated version of decimal.js. Would be great if you could verify whether this actually solves the issue. |
Confirmed, updated to v3.9.3 and the React packager is now able to create production bundles. Thanks a lot for your swift response! |
Awesome! thanks for your feedback. |
Hi! First let me just say thank you to all the contributors for their hard work on this brilliant library, keep up the good work!
Problem description
React Native is library/framework to make native mobile apps with JavaScript. When using math.js v3.9.2 as a dependency production builds can no longer be created with the React Native packager. Development builds work correctly (running in a simulator, etc) but not production builds (which are required to publish apps).
Related GitHub issues:
require
values facebook/react-native#10816require
detection buster MikeMcl/decimal.js#42Reproduction
https://github.com/jonrh/react-native-mathjs-bug
I created a small sample React Native project where I investigated a bit the cause of the problem. In the project readme I trace and document things as I went along. The problem can be reproduced by attempting to create a production bundle with the React Native packager by running the following command:
This produces the following error message:
For reference I did attempt the above instructions but without success.
Potential solution
Upgrade decimal.js dependency from v5.0.8 to at least v7.1.1. See here for rationale.
Temporary fix
To be able to make production builds in React Native one possible temporary solution would be to replace the contents of the file
node_modules/decimal.js/decimal.js
with that of the fixed file here. Raw content link.Other information
This may not inherently be the fault of decimal.js nor math.js but rather the React Native packager itself. I'm not too sure about it but given that decimal.js v7.1.1 seems to work without issues I'm optimistic that if upgraded this might at least solve the conflict between Math.js and React Native. Thank you for your time and devotion!
The text was updated successfully, but these errors were encountered: