You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It all works well except that their internal webpack bundler is adding the following node_modules paths to the bundle duplicating the react entries.
producing:
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
by enforcing in their webpack config: resolve.alias to map to the react-dom and react entries to the first path fixes the issue.
Is there a way to help debugging or fixing this sort of issues in a more general way?
Fund our work
Sponsor our open source work by donating a bug bounty
The text was updated successfully, but these errors were encountered:
Hmm. This needs some investigation to determine the root cause and a find principled fix. I haven't tried running storybook with js_run_devserver yet. The underlying cause if probably an esm import within storybook that is allowing an import to escape the runfiles tree (#362).
Bazel duplicates the node_modules tree in runfiles (bazel-out/k8-fastbuild/bin/start_storybook_server.sh.runfiles/foobar/node_modules). Its just a symlink to the tree in the execroot (bazel-out/k8-fastbuild/bin/node_modules). js_run_devserver symlinks the runfiles node_modules tree into a custom devserver "sandbox". In theory it could symlink the node_modules tree in the execroot instead by default which would resolve this.
What happened?
I'm trying to use storybook binary via:
It all works well except that their internal webpack bundler is adding the following node_modules paths to the bundle duplicating the react entries.
producing:
Version
How to reproduce
No response
Any other information?
From the browser, I noticed that the webpack loaded sources contain:
by enforcing in their webpack config: resolve.alias to map to the react-dom and react entries to the first path fixes the issue.
Is there a way to help debugging or fixing this sort of issues in a more general way?
Fund our work
The text was updated successfully, but these errors were encountered: