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

Does this work in non-React setups? #14

Open
3 tasks done
tflx opened this issue Aug 31, 2022 · 10 comments
Open
3 tasks done

Does this work in non-React setups? #14

tflx opened this issue Aug 31, 2022 · 10 comments

Comments

@tflx
Copy link

tflx commented Aug 31, 2022

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

@maraisr
Copy link
Owner

maraisr commented Aug 31, 2022

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

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

@lukemcd-hero
Copy link

@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.

@mantismamita
Copy link

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

maraisr added a commit that referenced this issue Sep 20, 2022
maraisr added a commit that referenced this issue Sep 20, 2022
@maraisr
Copy link
Owner

maraisr commented Sep 20, 2022

@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 maraisr closed this as completed Sep 20, 2022
@mantismamita
Copy link

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

@lukemcd-hero
Copy link

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

@tflx
Copy link
Author

tflx commented Oct 11, 2022

@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.

@mantismamita
Copy link

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

@maraisr maraisr reopened this Oct 23, 2022
@maraisr
Copy link
Owner

maraisr commented Oct 23, 2022

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

@cupcakearmy
Copy link

Same here with Vite.

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

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

5 participants