Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alekangelov opened this issue Aug 5, 2022 · 3 comments
Closed

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

alekangelov opened this issue Aug 5, 2022 · 3 comments

Comments

@alekangelov
Copy link

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.

@IvanRodriCalleja
Copy link
Owner

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.

@alekangelov
Copy link
Author

alekangelov commented Aug 5, 2022

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

@alekangelov
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants