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

Prevent JS error in an empty cart #68

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

PromInc
Copy link
Contributor

@PromInc PromInc commented Sep 8, 2021


name: PR Template

Description

A javascript error is thrown when visiting an empty cart page.
"Uncaught TypeError: Cannot read properties of undefined (reading '0')"

How To Reproduce

Steps to reproduce the behavior:

  1. Go to the cart page with no products in the cart
  2. See error in the browsers developer tools console tab

Expected behavior

No error thrown

Screenshots

Benefits

Reduces white-noise errors that are thrown thus making it easier for developers to focus on errors that matter. Also is good practice to write good code.

Additional information

This is the JS error thrown:
"Uncaught TypeError: Cannot read properties of undefined (reading '0')"

Steps to recreate:
* Visit an empty cart page
* Look in the developer tools console tab and notice the error
Bug fix: datepicker doesn't load and thus prevents saving of the page.
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 this pull request may close these issues.

1 participant