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

[Bug] using storybook-addon-swc breaks this addon #17

Closed
Djiit opened this issue Mar 6, 2023 · 3 comments · Fixed by #27
Closed

[Bug] using storybook-addon-swc breaks this addon #17

Djiit opened this issue Mar 6, 2023 · 3 comments · Fixed by #27
Labels
bug Something isn't working

Comments

@Djiit
Copy link

Djiit commented Mar 6, 2023

Describe the bug

When using storybook-addon-swc, this addons complains about the code not being implemented.

Steps to reproduce the behavior

  1. Add https://storybook.js.org/addons/storybook-addon-swc to a project
  2. Use this addon

Expected behavior

Coverage works

Screenshots and/or logs

All tests return:

   [Test runner] An error occurred when evaluating code coverage:
             The code in this story is not instrumented, which means the coverage setup is likely not correct.
             More info: https://github.com/storybookjs/test-runner#setting-up-code-coverage

Environment

  • OS: MacOS and Linux
  • Node.js version: 18.X
  • NPM version: yarn 1.22.19
@Djiit Djiit added the bug Something isn't working label Mar 6, 2023
@taozhou-glean
Copy link

taozhou-glean commented Aug 10, 2023

any update on this ? we are getting exact same errors

tried to enable source maps on both swc and webpack end, and pass useInlineSourceMaps to this addon, but still no luck :(

@s8n11c
Copy link

s8n11c commented Oct 9, 2023

You need to remove @storybook/addon-coverage and replace it with https://github.com/kwonoj/swc-plugin-coverage-instrument

as storybook-addon-swc replaces addon-coverage babel configs presets with SWC loaders you need a plugin to set the instruments for coverage in swc.

@sebaguozden
Copy link

@s8n11c can you help me with this one #28?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants