Skip to content

[bug]: ToasterProps #7525

Open
Open
@slhck

Description

@slhck

Describe the bug

Installing sonner:

npx shadcn@latest add sonner

… adds this in src/components/ui/sonner.tsx:

import { Toaster as Sonner, ToasterProps } from "sonner"

However, ToasterProps should be imported as type ToasterProps, otherwise we get:

src/components/ui/sonner.tsx:2:29 - error TS1484: 'ToasterProps' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

2 import { Toaster as Sonner, ToasterProps } from "sonner"

This is with the default Vite setup.

Affected component/components

sonner

How to reproduce

See above.

Codesandbox/StackBlitz link

No response

Logs

System Info

Node 22, tsc 5.8.3.

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions