Assistance Migrating from Haul
See original GitHub issueHi All, Thank you for your work on this library (and Haul)!
I am attempting to transition to this library in an app where we are currently using Haul because of an issue I am having not being able to use flipper (or inspect network requests in Haul’s debugger). When I run npx react-native webpack-start
, the server starts, but the application errors. I am really struggling to get additional data, but all I can pull up right now is this stack trace which appears to be rooting from my webpack.config.js
:
Error loading webpack configuration at “/Users/swoodruff/dev/stormbreaker/apps/plant-floor/webpack.config.js”: Error: Cannot find module ‘webpack/lib/web/JsonpHelpers’ Require stack: /Users/swoodruff/dev/stormbreaker/common/temp/node_modules/.pnpm/packages.plexdev.io/react-native-webpack-toolkit/1.0.0_28331a31dd8e7476d616c398e649ea17/node_modules/react-native-webpack-toolkit/dist/webpack/plugins/ReactNativeTarget/ReactNativeChunkLoadingPlugin.js /Users/swoodruff/dev/stormbreaker/common/temp/node_modules/.pnpm/packages.plexdev.io/react-native-webpack-toolkit/1.0.0_28331a31dd8e7476d616c398e649ea17/node_modules/react-native-webpack-toolkit/dist/webpack/plugins/ReactNativeTarget/ReactNativeTargetPlugin.js
I am using the template webpack.config.js recommended. The only changes I have made were
- I uncommented the section
alias
to ensure all react-native* imports are resolved to the same RN dependency. I am working in a mono repo built with rush, if that helps at all. - Added a fallback for
entry
to./index.js
.
Any insight or help is really appreciated. I will include any more information that can be of use… I am feeling so lost right now though, I don’t have any more to add.
Thank you in advance!
EDIT: Attaching a screenshot to what I believe my issue is. On line 8, it is requiring the file JsonHelpers, but I do not see that file in node_modules/webpack/lib/web
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (11 by maintainers)
Thanks for the info, I’ll take a closer look at it again tomorrow. FYI you can actually put Webpack config in a subdirectory - RNWT has the same resolution as Webpacka CLI: https://www.github.com/callstack/react-native-webpack-toolkit/tree/main/src%2Fcommands%2Futils%2FgetWebpackConfigPath.ts
@zamotany - thanks so much for the quick reply. I was able to get by this after using the steps you provided. The only other issue I came across was another missing dependency I had to install. After installing
babel-loaded
, I was up and running.