-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using with TypeORM #78
Comments
You need to restart metro (and the cache) but cannot tell you more, I got it working once with the patch exporting the |
Did you solve it? |
Same error. Sometimes is: Error: Requiring module "node_modules/typeorm/browser/driver/react-native/ReactNativeDriver.js", which threw an exception: Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run or Error: Requiring unknown module "undefined". If you are sure the module exists, try restarting Metro. You may also want to run Version info: |
I found a solution, just add |
@ospfranco I am using TypeScript and typeorm/typeorm#9178 does not fix it. Instead I am having this weird error
More digging into sources in node_modules I found that the most likely cause is metro trying to hoist the optional My current workaround is to also install This is sub-optimal because hoisting almost suggest the bundling of Is there a better way to do it? |
No idea sorry, no time to debug issues right now |
TBH It looks very much like a TypeORM issue to me, I don't think the require phase and metro's behavior is within the scope of this project. Much appreciated if you would take a quick look and confirm this later, please take your time. |
Yeah, this is a problem with Metro and the hardcoded requires of TypeORM, I already tried to debug it and found the instructions on the README working, but not using the library at the moment. |
OK I'll stick with my workaround for the time being, thanks for replying! |
If you don't want to edit your node_modules, I created a patch of TypeORM with a couple of the fixes mentioned: typeorm/typeorm@master...elliotsayes:react-native-typeorm:dev
|
I have a bit of free time at the moment, looking into this. I managed to get metro to correctly link typeorm by adding the "./package.json" export on the typeorm root package.json file. I'm now facing the |
Got it working. I fixed the driver and added new instructions on the Readme: https://github.com/ospfranco/react-native-quick-sqlite#typeorm The new driver is published under 6.1.0 |
Description
Hey! Thanks for making this great package. I'm attempting to use it with TypeORM but getting the following error when initializing
typeorm
,reflect-metadata
and the required babel plugins installed (tried clearing all cache already)"./package.json": "./package.json"
to the TypeORM package.json fileDataSource setup:
Also looks like the latest commit commented out the TypeORM code from the
example
project, so I was wondering if the readme is up to date on the necessary steps for getting setupAdditonal info
"react-native": "0.68.2",
The text was updated successfully, but these errors were encountered: