infinitered / reactotron

A desktop app for inspecting your React JS and React Native projects. macOS, Linux, and Windows.
https://docs.infinite.red/reactotron/
MIT License
14.93k stars 944 forks source link

Storybook broken in `apps/reactotron-app` #1369

Open jamonholmgren opened 11 months ago

jamonholmgren commented 11 months ago

"Can't resolve 'fs'" -- appears to be trying to load fs in a browser context.

Replicate:

yarn
cd apps/reactotron-app
yarn build-storybook

Error:

ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in '/Users/jh/Code/infinitered/reactotron/node_modules/electron'
    at /Users/jh/Code/infinitered/reactotron/node_modules/webpack/lib/Compilation.js:925:10
jamonholmgren commented 11 months ago

Note if you're using Node 18+, you may also need to pass NODE_OPTIONS=--openssl-legacy-provider prior to building:

NODE_OPTIONS=--openssl-legacy-provider yarn build-storybook
frankcalise commented 11 months ago

I found that if you throw this into apps/reactotron-app/.storybook/webpack.config.js it builds but still run into an fs error

node: {
      ...config.node,
      fs: "empty",
    },

Maybe we could try updating to the latest storybook and webpack?