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

TypeError: Cannot read properties of undefined (reading 'toLowerCase') #9

Closed
vupham84 opened this issue Sep 20, 2021 · 2 comments · Fixed by #10
Closed

TypeError: Cannot read properties of undefined (reading 'toLowerCase') #9

vupham84 opened this issue Sep 20, 2021 · 2 comments · Fixed by #10

Comments

@vupham84
Copy link

Hi, I follow the instruction but get the following error when I start the web app.

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'toLowerCase')

Source
utils/prices.js (24:64) @ eval

22 |
23 | let moneyAmount = variant.prices.find(

24 | (p) => p.currency_code.toLowerCase() === cart.currency_code.toLowerCase()
| ^
25 | );
26 |
27 | if (moneyAmount && moneyAmount.amount) {

@noahrinehart
Copy link

I believe it is because cart.currency_code here should be cart.region.currency_code instead, which is what it is like on L39

@kasperkristensen
Copy link
Collaborator

kasperkristensen commented Sep 30, 2021

@vupham84 @kjcsb1 Thank you for pointing out the error, the issue should be resolved now 👍

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

Successfully merging a pull request may close this issue.

3 participants