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

Toast: Crashing when no severity value is provided #4063

Closed
crewcall opened this issue Jun 18, 2023 · 0 comments
Closed

Toast: Crashing when no severity value is provided #4063

crewcall opened this issue Jun 18, 2023 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@crewcall
Copy link

crewcall commented Jun 18, 2023

Describe the bug

According to the docs, when adding a toast, theseverity value is optional and it defaults to"info", so when we provide no severity value, the toast should render as an info toast.

But if we use the following code, the rendering of the toast fails.

  toast.add({
    summary: "Info",
    detail: "Message Content",
    life: 3000,
  });

It throws an Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating '$options.iconComponent.name') error.

This code works as expected:

  toast.add({
    severity: "info",
    summary: "Info",
    detail: "Message Content",
    life: 3000,
  });

Reproducer

https://codesandbox.io/p/sandbox/lingering-star-zq3cdk?file=%2Fsrc%2FApp.vue%3A31%2C13

PrimeVue version

3.29.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

Open the codesandbox and click on the button to show a toast and raise the error.

Expected behavior

The toast should work without providing a severity value.

@crewcall crewcall added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 18, 2023
@crewcall crewcall changed the title Toast: Failing if no severity is provided Toast: Crashes if no severity value is provided Jun 18, 2023
@crewcall crewcall changed the title Toast: Crashes if no severity value is provided Toast: Crashing if no severity value is provided Jun 18, 2023
@crewcall crewcall changed the title Toast: Crashing if no severity value is provided Toast: Crashing when no severity value is provided Jun 18, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 20, 2023
@tugcekucukoglu tugcekucukoglu added this to the 3.30.0 milestone Jun 20, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants