Skip to content

@carbon/ibmdotcom-react v1.66.1: CTA component crashes entire page with client-side error #12246

@PatrikHysky

Description

@PatrikHysky

Description

The <CTA> component causes an enitre page to crash in certain conditions with a client-side error. When two or more <CTA> components of type="video" are placed on a page and the videos are not found in MediaCenter, the page crashes with: TypeError: _videoTitle$0$duratio.replace is not a function

This should not occur, the CTA component should handle error conditions gracefully instead of causing the entire page to crash. Using "@carbon/ibmdotcom-react": "^1.66.1"

Component(s) impacted

For example, add this code to any page in React. The page will crash upon loading with a client-side error in the CTA component.

import {CTA} from "@carbon/ibmdotcom-react";

<CTA style="card" type="video" media={{src: "1_4u3oc7ak", type: "video"}}/>
<CTA style="card" type="video" media={{src: "1_i8oho41k", type: "video"}}/>

Browser

No response

Carbon for IBM.com version

1.66.1

Severity

Severity 1 = The design is broken in a critical way that blocks users from completing tasks or damages the brand. Affects major functionality, no workaround.

Application/website

IBM Redbooks

Package

@carbon/ibmdotcom-web-components

CodeSandbox example

N/A

Steps to reproduce the issue (if applicable)

Add this code to any page in React. The page will crash upon loading with a client-side error in the CTA component.

<CTA style="card" type="video" media={{src: "1_4u3oc7ak", type: "video"}}/>
<CTA style="card" type="video" media={{src: "1_i8oho41k", type: "video"}}/>

Release date (if applicable)

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdevNeeds some dev work

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions