mymonero / mymonero-app-js

The JS codebase for the MyMonero desktop apps
BSD 3-Clause "New" or "Revised" License
530 stars 156 forks source link

RangeError: Incorrect locale information provided #426

Open proudmuslim-dev opened 3 years ago

proudmuslim-dev commented 3 years ago

Description

Constantly spamming error window

Steps to reproduce

  1. Open MyMonero
  2. Wait a little bit

Expected behavior:

Expected the app to function normally

Actual behavior:

Notifications on my screen every 30 or so seconds

Link to an example: [optional] image

Versions

karlbuys commented 3 years ago

Hi there

Apologies for the slow response.

That error has to do with the wallet attempting to display a transaction's date in your local timezone. My suspicion is that your timezone and/or locale have not been set up.

Please check to see that your locale and timezone are set properly.

In /etc/locale.conf, you should see two strings that looks like the following:

LC_TIME=en_GB.UTF-8 LANG=en_GB.UTF-8

If those lines aren't there, please follow the steps at https://wiki.archlinux.org/title/locale#Setting_the_locale and let us know if you continue to have issues

proudmuslim-dev commented 3 years ago

Hi! It turns out that you are correct, I don't have LC_TIME set image

Apologies for bothering you guys, I'll set the variable and close this after some testing

proudmuslim-dev commented 3 years ago

Update: I've updated my locale following the instructions from the wiki, and the issue persists

image

image image

karlbuys commented 3 years ago

Could you check to see if "en_US.UTF-8 UTF-8" is uncommented in /etc/locale.gen please?

If it is, remove the # before it. See below for example:

en_SG ISO-8859-1

en_US.UTF-8 UTF-8

en_US ISO-8859-1

Then, run locale-gen

Please let me know if this sorts the issue out.

proudmuslim-dev commented 3 years ago

Yes, it's uncommented as I did it during the installation process image

karlbuys commented 2 years ago

I've been looking at the code causing the issue. I suspect that the problem is due to two reasons. I believe Arch Linux is using non-standard locale codes. en-US is a valid locale code according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString.

When we're unable to determine the user's locale, we were falling back to 'en-US'. A better solution is to specify the locale as the type 'undefined', which will use the system's default provided locale.

JohnnyKarate2 commented 2 years ago

Will this issue be fixed sometime soon? I can't access my wallet right now

Clausinho commented 2 years ago

Will this issue be fixed sometime soon? I can't access my wallet right now I am experiencing the same issue on arch linux. I can however click it away and use my wallet, even though it is quite tedious.

Is there a way to just mute these errors, as they don't seem to impair any features apart from sending annoying error alerts.

devinpearson commented 2 years ago

will put out an update tomorrow.

JohnnyKarate2 commented 2 years ago

Awesome, thanks!

storopoli commented 2 years ago

I am still seeing this in Arch Linux using version 1.2.4:

❯ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_TIME=en_US.UTF-8
vivyir commented 2 years ago

I am also seeing this error, not particularly fond of changing my whole system's language to English, maybe adding a fallback mechanism to the app would be better?

Edit: I've just read above and i think falling back to my system locale is a problem aswell, it's Esperanto, i have no idea how to fix this, also, tried changing LC_ALL to en_GB.UTF-8 in a terminal and then launching mymonero, no difference

AndreiBiziuk commented 1 year ago

After update to v1.3.3-2 receive this error every time when click on wallet with transactions.

An unexpected application error occurred.

Please let us know of the following error message as it could be a bug:

 <p><span style='font-size: 11px;'>RangeError: Incorrect locale information provided</span></p>RangeError: Incorrect locale information provided
    at Date.toLocaleDateString (<anonymous>)
    at /opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:883:37
    at Array.forEach (<anonymous>)
    at WalletDetailsView._configureUIWithWallet__transactions (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:816:31)
    at WalletDetailsView.setup (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:44:10)
    at new WalletDetailsView (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:29:10)
    at WalletsListView.pushRecordDetailsView (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:232:20)
    at WalletsListView.cellWasTapped (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:251:12)
    at WalletsListCellView.cell_tapped_fn (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:186:15)
    at /opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListCellView.web.js:96:14Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) MyMonero/1.3.3 Chrome/83.0.4103.122 Electron/9.4.4 Safari/537.36

Previously there was no errors.

my locale is ru_RU.UTF-8

OS: Arch Linux

amusingaxl commented 8 months ago

Same issue here on Manjaro. When I installed the AppImage standalone, I didn't see this issue, but then I removed it and used the AUR package, which caused the error to appear. I'd like to use the AUR package because of the automatic updates.

An unexpected application error occurred.

Please let us know of the following error message as it could be a bug:

 <p><span style='font-size: 11px;'>RangeError: Incorrect locale information provided</span></p>RangeError: Incorrect locale information provided
    at Date.toLocaleDateString (<anonymous>)
    at /opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:883:37
    at Array.forEach (<anonymous>)
    at WalletDetailsView._configureUIWithWallet__transactions (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:816:31)
    at WalletDetailsView.setup (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:44:10)
    at new WalletDetailsView (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:29:10)
    at WalletsListView.pushRecordDetailsView (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:232:20)
    at WalletsListView.cellWasTapped (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:251:12)
    at WalletsListCellView.cell_tapped_fn (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:186:15)
    at /opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListCellView.web.js:96:14Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) MyMonero/1.3.3 Chrome/83.0.4103.122 Electron/9.4.4 Safari/537.36
SunilPaul174 commented 3 months ago

An unexpected application error occurred.

Please let us know of the following error message as it could be a bug:

RangeError: Incorrect locale information provided

RangeError: Incorrect locale information provided at Date.toLocaleDateString () at /opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:883:37 at Array.forEach () at WalletDetailsView._configureUIWithWallet__transactions (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:816:31) at WalletDetailsView.setup (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:44:10) at new WalletDetailsView (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:29:10) at WalletsListView.pushRecordDetailsView (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:232:20) at WalletsListView.cellWasTapped (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:251:12) at WalletsListCellView.cell_tapped_fn (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:186:15) at /opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListCellView.web.js:96:14Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) MyMonero/1.3.3 Chrome/83.0.4103.122 Electron/9.4.4 Safari/537.36 Still having this issue on ![image](https://github.com/user-attachments/assets/ab8cb1d7-4066-4384-b16d-da6fb446ba51)
r3k2 commented 1 month ago

Having this same error on Arch GNU/Linux this used to work last year or so.

An unexpected application error occurred.

Please let us know of the following error message as it could be a bug:

 <p><span style='font-size: 11px;'>RangeError: Incorrect locale information provided</span></p>RangeError: Incorrect locale information provided
    at Date.toLocaleDateString (<anonymous>)
    at /opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:883:37
    at Array.forEach (<anonymous>)
    at WalletDetailsView._configureUIWithWallet__transactions (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:816:31)
    at WalletDetailsView.setup (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:44:10)
    at new WalletDetailsView (/opt/mymonero/resources/app.asar/local_modules/Wallets/Views/WalletDetailsView.web.js:29:10)
    at WalletsListView.pushRecordDetailsView (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:232:20)
    at WalletsListView.cellWasTapped (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:251:12)
    at WalletsListCellView.cell_tapped_fn (/opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListView.web.js:186:15)
    at /opt/mymonero/resources/app.asar/local_modules/Lists/Views/ListCellView.web.js:96:14Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) MyMonero/1.3.3 Chrome/83.0.4103.122 Electron/9.4.4 Safari/537.36
```
cat /etc/locale.conf 

LANG=en_US.UTF-8


i also tried passing the LANG= variable to mymonero same problem :(