Skip to content

Prevent JS error in an empty cart#68

Open
PromInc wants to merge 3 commits into
Affirm:masterfrom
PromInc:master
Open

Prevent JS error in an empty cart#68
PromInc wants to merge 3 commits into
Affirm:masterfrom
PromInc:master

Conversation

@PromInc

@PromInc PromInc commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

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