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
If a developer uses Yarn to add any dependencies to the library root (not the example), the resulting library root node_modules would cause the example app to crash.
Recommended workaround solutions:
always stop Metro if running and remove node_modules from the library root after adding library dependencies and before running the example (it may be required to do yarn in the example to update the node_modules there)
consider manually adding any library root dependencies to the library root peerDependencies and devDependencies then using Yarn to add such dependencies to the example itself
original description
If I would create a library module with an example, run the example, add a dependency such a `prop-types` to the library root (not the example), and then try running again, then the app will crash. I think the bundler will show some error output at this point.
The workaround is to remove node_modules from the library root, restart Metro, then reinstall and restart the app.
I think this issue needs to be documented and investigated further.
The text was updated successfully, but these errors were encountered:
brodycj
changed the title
Workaround needed when adding dependencies to the library root
example quirk: issue with adding dependencies to the library root
Apr 7, 2020
I got the same error and it worked when I removed react-native inside the devDependencies of the root library (not the example). Then I can run my application with dependencies, devDependencies, and peerDependencies in root library by installing node_modules for the root library and example.
Oh thanks for reporting this @brodybits, I feel like I've been banging my head against a wall all day. If you hadn't logged the above, I'd still be doing the same. I love the create-react-native-module tool by the way.
updated:
If a developer uses Yarn to add any dependencies to the library root (not the example), the resulting library root node_modules would cause the example app to crash.
Recommended workaround solutions:
yarn
in the example to update the node_modules there)This issue was originally reported on the interactive CLI tool in brodycj/react-native-module-init#42.
original description
If I would create a library module with an example, run the example, add a dependency such a `prop-types` to the library root (not the example), and then try running again, then the app will crash. I think the bundler will show some error output at this point.The workaround is to remove node_modules from the library root, restart Metro, then reinstall and restart the app.
I think this issue needs to be documented and investigated further.
The text was updated successfully, but these errors were encountered: