-
Notifications
You must be signed in to change notification settings - Fork 10
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
formatNumber
method from Currency Module
is throwing error while running in a non-browser environment (e.g., Node.js)
#36
Comments
Just a quick question. If someone raises an issue then can't they fix that issue as well? Did I miss something or someone outside Razorpay are not allowed to fix issues? Can someone guide me on this? |
@sakigo9 to answer your above question, if someone raises an issue then they CAN fix that issue as well. Thanks for raising the issue and a PR for it's fix. Have left some comments, please address those. |
Thanks for answering @RgnDunes. |
Steps to reproduce the issue
npm i @razorpay/i18nify
."@razorpay/i18nify": "^1.2.1"
.formatNumber
from the Currency Module. Refer to the below code to replicate the issueExpected vs. Actual behavior
Root Cause(Based on my observation)
The
window.navigator
object is specific to web browsers and is not available in Node.js. However, if we navigate here then we can observe that we are trying to usenavigator
which will work well for a browser environment. But Node.js is not running in a browser context, so you won't have access to browser-specific APIs likewindow.navigator
.I've reproduced the issue locally. I have a fix for this solution, once this issue is verified, please allow me to fix this issue through a PR.
Please let me know if any additional information is required.
The text was updated successfully, but these errors were encountered: