You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm happy to attempt a fix for this when I have some time. ✌️❤️
Steps to reproduce the bug 🔁:
Bundle Sonner with another library and try to output .d.ts files, e.g.:
a. Using parcel
b. Using emit declaration with Typescript compiler
Examples of error output from Parcel:
🚨 Build failed.
@parcel/transformer-typescript-types: Exported variable 'toast' has or
is using name 'Action' from external module
"/Users/{USER}/src/{PACKAGE}/node_modules/sonner/dist/index"
but cannot be named.
/Users/{USER}/src/{PACKAGE}/src/toaster/index.tsx:14:14
13 |*/
> 14 |export const toast = sonnerToast;>| ^^^^^ Exported variable 'toast' has or is using name 'Action' from external module "/Users/{USER}/src/{PACKAGE}/node\_modules/sonner/dist/index" but cannot be named.
15 |
16 | /**
@parcel/transformer-typescript-types: Exported variable 'toast' has or
is using name 'ToastClassnames' from external module
"/Users/{USER}/src/{PACKAGE}/node_modules/sonner/dist/index"
but cannot be named.
/Users/{USER}/src/{PACKAGE}/src/toaster/index.tsx:14:14
13 |*/
> 14 |export const toast = sonnerToast;>| ^^^^^ Exported variable 'toast' has or is using name 'ToastClassnames' from external module "/Users/{USER}/src/{PACKAGE}/node\_modules/sonner/dist/index" but cannot be named.
15 |
16 | /**
@parcel/transformer-typescript-types: Exported variable 'toast' has or
is using name 'ToastToDismiss' from external module
"/Users/{USER}/src/{PACKAGE}/node_modules/sonner/dist/index"
but cannot be named.
/Users/{USER}/src/{PACKAGE}/src/toaster/index.tsx:14:14
13 |*/
> 14 |export const toast = sonnerToast;>| ^^^^^ Exported variable 'toast' has or is using name 'ToastToDismiss' from external module "/Users/{USER}/src/{PACKAGE}/node\_modules/sonner/dist/index" but cannot be named.
15 |
16 | /**
The text was updated successfully, but these errors were encountered:
Describe the feature / bug 📝:
As not all types are exported, in some scenarios, types can't be named, e.g. when re-exporting Sonner as part of a library.
My specific issue arose when using Parcel to output .d.ts type definitions.
This has been reported before in this issue #399
And a fix was attempted in this PR, #400
I'm happy to attempt a fix for this when I have some time. ✌️❤️
Steps to reproduce the bug 🔁:
a. Using parcel
b. Using emit declaration with Typescript compiler
Examples of error output from Parcel:
The text was updated successfully, but these errors were encountered: