Comments (7)
Hi @jbroma starting a new react-native codebase with RePack, I was not able to use React-hook-form.
This is the only dependency that's a blocker from migrating my react native project meanwhile React-hook-form works well when it's installed in the super demo app.
Sorry that I tagged you, do you have any idea why it is so. Thank you
from repack.
Hi @jbroma after trial and error method, I was able to get it to work by removing \/ from
/node_modules(.*[/\])+react\//,
From this I guess it now matches the react-hook-form path.....
My question is that why is the / in the template config but not in the super app demo. Thank you
from repack.
Hi @vlack-coder,
We added that because it was too generic and some deps were picked up by mistake.
If changing that helped then adding a similar entry for just react-hook-form
should work as well.
from repack.
I tried this today and I get no conflicts and it works out of the box in new projects. Perhaps something changed in react-hook-form
that made it work out of the box? It shouldn't need transpiling as the library comes pretranspiled already.
I'll close this issue since you resolved your problems but also it's unclear that this was to default webpack.config
we provide. Feel free to post an update here and we might reopen this and find the proper root cause of this.
from repack.
Hi @jbroma
So I tried it again with a new repo that has only react-hook-form installed and still encountered the same issue.....
NB: I'm using the Controller component from react hook form
Link to the repo - Github Repo
from repack.
Thanks for providing the repro, I'll check it out and get back to you to.
from repack.
Hi @vlack-coder,
I was able to reproduce your error, I was able to fix it and get it to work by adding the react-hook-form
to transpiled modules inside of webpack.config
. In my repro I think I didn't manage to encounter the error because I didn't use enough of the lib to get to this error. Both metro
and webpack
resolve correctly to the same entrypoint (node_modules/react-hook-form/dist/index.cjs.js
), so aliasing shouldn't be neeed in this case.
Please do the following to resolve your issue:
rules: [
{
test: /\.[jt]sx?$/,
include: [
/node_modules(.*[/\\])+react\//,
/node_modules(.*[/\\])+react-native/,
/node_modules(.*[/\\])+@react-native/,
/node_modules(.*[/\\])+@react-navigation/,
/node_modules(.*[/\\])+@react-native-community/,
/node_modules(.*[/\\])+expo/,
/node_modules(.*[/\\])+pretty-format/,
/node_modules(.*[/\\])+metro/,
/node_modules(.*[/\\])+abort-controller/,
/node_modules(.*[/\\])+@callstack\/repack/,
/node_modules(.*[/\\])+react-hook-form/, // <-- add this
],
use: 'babel-loader',
},
]
We should have a permament fix for this resolution & transpilation issues in the future, right now this is the only way to get around that.
from repack.
Related Issues (20)
- Facing issue while implementing Offline Bundling. HOT 8
- Error in bundling micro apps with react-native-svg packages HOT 3
- [RFC] Override `start` command in `react-native.config.js` HOT 10
- Unhandled error in Webpack Compiler when doing `rpm run ios` HOT 2
- repack monorepo deployment help
- Android is crashing when "onMessage" props is accessed in "react-native-webview" library HOT 1
- [RFC] sync API HOT 14
- Improve types for `prefetchScript` and `loadScript` HOT 6
- Is it possible to load a remote module before it is requested by the user?
- callstack_repack-Swift.h file not found HOT 18
- Repack app fails with "could not find react-redux context value" for the latest versions of react-redux and @reduxjs/toolkit HOT 3
- Property 'HMRClient' doesn't exist HOT 4
- Challenge Integrating Repack in React Native Mono Repo: App1 Loads Successfully, App2 Fails to Load from Server Bundles HOT 3
- Extract runtime into separate package in monorepo & publish it separately HOT 4
- Migrate ObjC code parts to Swift HOT 5
- How do i use react-native-gesture-handler in both my mini app and host app? HOT 5
- Repack Navigation From Mini App To Main APP HOT 3
- Adopt the new federation runtime HOT 5
- A clear working example of how code signing works with repack HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repack.