Skip to content
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

[iOS] error: bundling failed: Error: Unable to resolve module ./build/index #4

Open
esutton opened this issue Feb 27, 2019 · 2 comments

Comments

@esutton
Copy link

esutton commented Feb 27, 2019

Has anyone succeeded to get this TypeORM example working on either iOS or Android?

I would love to find an ORM to replace Realm JS.

git clone https://github.com/typeorm/react-native-example.git
cd react-native-example
yarn
react-native run-ios

Results in red box error:

image

I cannot get Android to even get this far.

react-native run-android
Scanning folders for symlinks in /Users/jdoe/Documents/projects/react-native/typeorm_react-native-example/node_modules (20ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
Looking for JS files in
   /Users/edward3/Documents/projects/react-native/typeorm_react-native-example 


Metro Bundler ready.

Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `./build/index` from `/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/index.js`: The module `./build/index` could not be found from `/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/index.js`. Indeed, none of these files exist:

  * `/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/build/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/build/index/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:865)
    at ResolutionRequest.resolveDependency (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:92:16)
    at DependencyGraph.resolveDependency (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/node-haste/DependencyGraph.js:271:4465)
    at dependencies.map.relativePath (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:379:19)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:378:16)
    at /Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:203:33
    at Generator.next (<anonymous>)
    at step (/Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:307)
    at /Users/edward3/Documents/projects/react-native/typeorm_react-native-example/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:467
 BUNDLE  [ios, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.

Tips and suggestion are much appreciated.

@mohannad-mamo
Copy link

Hello @esutton
I am also facing similar error.
I ran:
git clone https://github.com/typeorm/react-native-example.git cd react-native-example yarn react-native run-ios
I got the errors about "Build input file cannot be found:" for double-conversion.cc, cached-powers.cc, diy-fp.cc, strtod.cc, fast-dtoa.cc, bignum.cc, fixed-dtoa.cc, bignum-dtoa.cc.

I noticed that react-native-sqlite-storage is not linked, so I did link it. now I got the error "'config.h' file not found"

So I cleaned the project and switched the build to legacy from the project settings. but the error stayed, I tried using relative path in project settings, but the error stayed the same.

@mohannad-mamo
Copy link

Hello @esutton

I have created a boiler plate for myself from scratch using the docs and two issues' comments:

  1. the problem with "experimentalDecorators" was solved using: “transform-decorators-legacy” does not work with next@7 vercel/next.js#5231 (comment)

  2. I had a problem with types -not sure why- but I had to specify the type in the entity, I got that thanks to: Column type for UserModel#userId is not defined and cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true option in tsconfig.json. typeorm#2897 (comment)

The repo was tested with ios & android, I hope it helps you
https://github.com/sheva007/typeorm-boilerplate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants