swc: issue using `@swc/plugin-emotion` with `swc` `.swcrc` - `failed to process input file`

Discussed in https://github.com/swc-project/swc/discussions/5450

<div type='discussions-op-text'>

Originally posted by pietrop August 11, 2022 👋 Hello, I am trying to use @swc/plugin-emotion with swc from swc-project/plugins/packages/emotion in .swcrc :

{
  "jsc": {
    ...
   "experimental": {
     "plugins": [ ["@swc/plugin-emotion", {}]]
  },

But when I run swc (npx swc ./src --config-file ./swcrc/.swcrc.commonjs -d dist/cjs) I get an error:

failed to process input file

For context, it seems to work fine if I remove the experimental and plugins attributes

And when I try to check the .swcrc in swc.rs/playground for  "experimental"  I get

Property experimental is not allowed Screen Shot 2022-08-11 at 11 46 07 AM

Btw I also get the same for "exclude" in case that’s relevant.

So I wanted to double check if I am doing something wrong? or whether there are known issues with plugins and/or the emotion plugin? 🙏

I also added an example repo to reproduce github.com/pietrop/cra-swc-emotion-plugin-example

Let me know if you need any other info, pretty stuck on this</div>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Please file a new issue instead

We did not update the issue if it’s resolved.

I should wait for a new release of @swc/core that combined with version

Yes, we expect so.

Just fyi, we found some regressions which requires to update @swc/core and plugins both. Probably worth to retry once there are some new changes.