Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

The ProductPrice Block is showing an error in the Storybook #8048

Closed
@tarhi-saad

Description

@tarhi-saad

Describe the bug

If we select the ProductPrice to display our block in the Storybook, an error is displayed instead:

image

To reproduce

Steps to reproduce the behavior:

  1. Go to the Storybook. You should see an error displayed instead of the ProductPrice component
  2. Select the Sale and Range variations. You should see the same error displayed
Cannot read properties of undefined (reading 'minorUnit')
TypeError: Cannot read properties of undefined (reading 'minorUnit')
    at FormattedMonetaryAmount (https://woocommerce.github.io/woocommerce-blocks/main.513e3732.iframe.bundle.js:1:116428)
    at Ch (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2206074)
    at ck (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2257911)
    at bk (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2245256)
    at ak (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2245187)
    at Tj (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2245056)
    at Lj (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2242081)
    at Jg (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2239461)
    at lk (https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2255412)
    at https://woocommerce.github.io/woocommerce-blocks/vendors~main.d14fb5db.iframe.bundle.js:10:2256801

Expected behavior

We should see the component instead of an error

Screenshots

image

Environment

WordPress (please complete the following information):

  • WordPress version: [e.g. 5.9]
  • Gutenberg version (if installed): [e.g. 12.0.0]
  • WooCommerce version: [e.g. 6.1]
  • WooCommerce Blocks version: [e.g. 7.0.0]
  • Site language:
  • Any other plugins installed:

Desktop (please complete the following information):

  • OS: [e.g. macOS, Windows]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

N/A

Metadata

Metadata

Assignees

Labels

status: staleStale issues and PRs have had no updates for 60 days.type: bugThe issue/PR concerns a confirmed bug.type: cooldownThings that are queued for a cooldown period (assists with planning).type: storybookIssues related to storybook.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions