storybook-addon-grid icon indicating copy to clipboard operation
storybook-addon-grid copied to clipboard

Does this work in non-React setups?

Open tflx opened this issue 1 year ago • 10 comments

Describe the bug

I tried to inlcude this in a web-components setup. Had to fiddle with your package.json in node_modules because of some nodejs/export error (don't know what that's about yet).

But once I had Storybook running the console gave me: "Can't perform a React state update on an unmounted component. …" It's a new and very basic project (only one component)

Have you or anyone tested it with Web components or other frameworks.

*edit The nodejs error is probably because I use Vite as Storybook builder. Apparently the exports in package.json is missing "." export. Deleting the whole "exports" part from package.json resolves it. I don't know if this has anything to do with the error i mentioned onced it is up and running.

To reproduce

Set up a new Web components project with Storybook and include the add-on.

Expected behavior

A working add-on :)

Validations

tflx avatar Aug 31 '22 08:08 tflx

I highly suspect this is a vite bug and not a react related thing.

I'll for sure check it out, thanks for flagging! 💕

maraisr avatar Aug 31 '22 13:08 maraisr

@maraisr I was about to create a similar issue regarding this. On my project the add-on is working but the browser console log consistently outputs the error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

While troubleshooting I discovered this error does not come up on React 18. Our project is React 17.0.2. Because React 18 is new we cannot upgrade our project in near term.

lukemcd-hero avatar Aug 31 '22 15:08 lukemcd-hero

I have a similar problem using it with svelte and vite as a builder. The error is

[vite] Internal server error: Missing "./dist/config/index.js" export in "storybook-addon-grid" package

mantismamita avatar Sep 19 '22 15:09 mantismamita

@mantismamita I have shipped a version 0.3.1 that should fix that issue.

@lukemcd-hero to your problem, this package doesn't depend directly on react. It's a peer dev and support 17 and above. That being said, I have just pushed a version to address the useEffect render bug, lame StrictMode double render shenanigans. Also so please look out for v0.3.1 🚀

maraisr avatar Sep 20 '22 06:09 maraisr

I installed the new version but am still getting the exact same error which is odd since ./dist/config/index.jsis clearly present.

mantismamita avatar Sep 20 '22 12:09 mantismamita

@maraisr the 3.1 update resolves the console log error I had been seeing. Thanks!

lukemcd-hero avatar Sep 20 '22 12:09 lukemcd-hero

@mantismamita I'm also still getting that error, but I'm pretty sure it's a Vite thing. I just can't find the info on it again. I think this is gonna be one those things where no one is gonna "fix it" soon because it isn't an error, just different opinions on how stuff like this should work.

tflx avatar Oct 11 '22 10:10 tflx

@tflx yes, eventually there may be more people using vite and non-React setups but for now we're in the minority.

mantismamita avatar Oct 23 '22 09:10 mantismamita

I'm opening this issue again, noticed it wasn't working for myself either with a vite setup.

maraisr avatar Oct 23 '22 11:10 maraisr

Same here with Vite.

[vite] Internal server error: Missing "./dist/config/index.js" export in "storybook-addon-grid" package

cupcakearmy avatar Jan 30 '23 12:01 cupcakearmy