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
When a decorator is applied to a class that is exported as a default export, the default export contains the original class and not the new value returned from the class decorator.
This works as expected for normal exports.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
When a decorator is applied to a class that is exported as a default export, the default export contains the original class and not the new value returned from the class decorator.
This works as expected for normal exports.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.3-nightly-20240301.1&code=H4sIAAAAAAAAA3NISU3OL0osyS%2FiSq0oyC8qUUhJTUsszSlRSM5JLC5WcK1IzC3ISVWorgUAU7BXiCoAAAA%3D&config=H4sIAAAAAAAAA02NsQrDMAxE93yF0ZxCcLd8SHfhqiGF2uakQkPIv1duSOgg0N3pndYuBHpqojGsvrqoDBWc2h1dsvHHHbKliibM1ag%2F0rukArYC9QvDW37BtudkjEmssaJxiJEOH5z1UfD6f3RW3QQ6l9ywBl2GK%2B2tXZvtC1n9TOu1AAAA
SWC Info output
No response
Expected behavior
The class should first be decorated and then exported, like this:
Actual behavior
SWC compiles to
Outside the module, only the original class is accessible, not the decorated version.
Version
1.4.3
Additional context
Might be related to #8515
The text was updated successfully, but these errors were encountered: