magic-akari/swc_mut_cjs_exports

SyntaxError: Unexpected token '<' after upgrading @swc/core to 1.3.39

pneme opened this issue · 7 comments

pneme commented

Screenshot 2023-03-13 at 14 30 57

I'm running into this no matter what version of @swc/core I use, tried go to down to 1.2.0, could be a misconfiguration of some sort?

I discovered this issue today during an upgrade:

    /example/test.ts:55
    describe("generate", <>()=>{});
                         ^

    SyntaxError: Unexpected token '<'

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1495:14)

I don't think this is an wasm plugin, but I did see this new doc.

pneme commented

Our codebase involves Nest.js and the only setup I could get working for unit test is using swc with jest_workaround up until 1.3.39 release.

pneme commented

@magic-akari Thanks for fixing this. Could you please publish the latest release also to npm? 🙏

@magic-akari Thanks for fixing this. Could you please publish the latest release also to npm? 🙏

I believe it has already been published on npm.
https://www.npmjs.com/package/jest_workaround/v/0.1.16

pneme commented

@magic-akari I see it now, thanks. However I tried upgrading jest_workaround to 0.1.16 and @swc/core to 1.3.40 (even tried 1.3.39) but reported problem still persists.

@magic-akari I see it now, thanks. However I tried upgrading jest_workaround to 0.1.16 and @swc/core to 1.3.40 (even tried 1.3.39) but reported problem still persists.

I have encountered a similar problem during my local testing process.
It appears that there is an issue with the caching of swc/jest.
You may attempt to resolve it by running jest --clearCache.