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
We are using Vitest to run tests for a NestJS application which relies on legacy decorators. SWC is used to do the transpilation. After updating from version 1.7.28 to 1.7.35 tests started failing.
Input code
NestJS provider.
@Injectable()exportclassMyService{}
Test suite.
import{MyService}from'./MyService.js';describe('MyService',()=>{it('should test something',async()=>{constservice=newMyService();
...
});});
Config
Using the unplugin-swc plugin for Vitest to configure SWC.
The compiled output should not break. Same as version 1.7.26.
Actual behavior
Either we get the error Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead. or SyntaxError: Invalid or unexpected token.
Version
1.7.35
Additional context
No response
The text was updated successfully, but these errors were encountered:
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
We are using Vitest to run tests for a NestJS application which relies on legacy decorators. SWC is used to do the transpilation. After updating from version
1.7.28
to1.7.35
tests started failing.Input code
NestJS provider.
Test suite.
Config
Using the
unplugin-swc
plugin for Vitest to configure SWC.Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.35&code=H4sIAAAAAAAAA0srzUsuyczPU%2FDMy0pNLklMyknVSM7PKy4pKk0uyS%2ByUnCDKtBUqObiquXickBSqMmVnJNYXKzgWxmcWlSWmZwKVgMAKWCzZFMAAAA%3D&config=H4sIAAAAAAAAA22RzU7DQAyE7zxFtOKImoIEh94QVSUO8A5m47Rb9k%2B2IxpVeXecn0ah9GjPtzMe7fmuKMw92wMGMJvCHEQyb8qSf%2ByKuByF1ZFTNA89GlLVeFTyrJPO0uZ%2BMsgvRjfdAB3ZLgigPcrIPK0fnwcf3WcgRpo53XAbBU492buyJZdlolWt0CYCScRKCDU4Ky7kRPLKaicuxYs%2ByN2UJgSR60RhGehxD7bdXoyvfefEDxSoQOAaaBi3WLuIu0RvHph3Dn11M%2F8bMQ%2FIJwT828DgKSO5gNreL8%2Fr37yP3UTIfTWC%2F7pjcFNzveEGXIPn6ZL5e4KLrm5nsfsF2uTyGAQCAAA%3D
SWC Info output
Expected behavior
The compiled output should not break. Same as version
1.7.26
.Actual behavior
Either we get the error
Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.
orSyntaxError: Invalid or unexpected token
.Version
1.7.35
Additional context
No response
The text was updated successfully, but these errors were encountered: