IvanRodriCalleja / emotion-swc-plugin

SWC transform plugin for Emotion

Home Page:https://www.npmjs.com/package/emotion-swc-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error when trying to use with storybook-addons-swc

alekangelov opened this issue · comments

This is a copy of a issue I filed with storybook-addon-swc found here: Karibash/storybook-addon-swc#41


I am getting the following error when trying to build storybook with SWC and the emotion-swc-plugin

Here's the error

Missing export __transform_plugin_process_impl', crates/swc/src/plugin.rs:222:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("filepath/.storybook/preview.js-generated-config-entry.js")'

Here's a reproduction repo:

https://github.com/alekangelov/emotion-swc-storybook-bug


Problem is I can't understand if it's this plugins fault or the other one, but leaning towards saying it's the storybook transform plugin, that's why I posted a copy here and not the original.

Hi @alekangelov,

Thanks for the reproduction example, i'll take a look to this but i saw this error some days ago and maybe it can be related, swc-project/plugins#48

I'll let you know if i find something, maybe you want to take a look to [@swc/plugin-emotion(https://github.com/swc-project/plugins/blob/main/packages/emotion) that is the official swc plugins to see if it works. Take into account that the code example is wrong and instead emotion-swc-plugin you have to use @swc/plugin-emotion as plugin name.

Hey thanks for the reply homie

the docs say emotion-swc-plugin even the carbon copy in @swc-project/plugins repo, Ill make some PRs to update the docs

I'll try it out right now

Well now it's kind of working. Build goes smoothly on the dummy repo, on the actual repo it doesn't, but when I try to run storybook this happens:

Caused by:
    0: failed to invoke `@swc/plugin-emotion` as js transform plugin at node_modules/@swc/plugin-emotion/swc_plugin_emotion.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob

I'll take up an issue with the guys over @swc-project thanks for the help