Comments (17)
Hello @merajcal .
Please create a index.js file as specified in the documentation.
https://github.com/thecodingmachine/react-native-boilerplate#running-the-project
from react-native-boilerplate.
Sorry, My bad. Just realized. Thanks
from react-native-boilerplate.
Hello @merajcal .
Please create a index.js file as specified in the documentation.
https://github.com/thecodingmachine/react-native-boilerplate#running-the-project
Hi @AurelGit
I'm having this same issue. I visited the link and couldn't find info on creating a 'index.js' file!
How do I create this file or there is another link to help with this?
Do let me know if I missed any info since I'm new to react-native app development.
Thanks
from react-native-boilerplate.
Hi @arvind-bookbox, welcome on the react-native community 😉
This issue dates from the version 1 ! Now we are on version 2 🚀.
Let me know what error is display in your metro bundler ? Is it the exact same : error: bundling failed: Error: While resolving module App/Config, the Haste package App was found. However the module Config could not be found within the package. Indeed, none of these files exist:
?
from react-native-boilerplate.
Hi @arvind-bookbox, welcome on the react-native community 😉
This issue dates from the version 1 ! Now we are on version 2 🚀.
Let me know what error is display in your metro bundler ? Is it the exact same :error: bundling failed: Error: While resolving module App/Config, the Haste package App was found. However the module Config could not be found within the package. Indeed, none of these files exist:
?
Hello Jeremy :)
Yes it is the same error. any ideas on how to fix this?
from react-native-boilerplate.
Did you create you project with the command npx react-native init MyApp --template @thecodingmachine/react-native-boilerplate
. Are you using the V2 of the boilerplate ? Because App/Config
isn't present anymore in the boilerplate. Now it's src/Config
. So having the same error as above is a little strange if you are using the V2
from react-native-boilerplate.
Hi,
I'm not using v2.
In fact this issue is happening in a project that I had moved from a friend. since I get the same error, I posted here.
Once I was able to get this working by renaming index.dev.js to index.js in App/Config folder. But this time I do not have any index.dev.js only index.production.js and index.staging.js files.
Since I'm new to react-native I find it difficult to understand the reason on how things can work or not!
Please advise. Thanks.
from react-native-boilerplate.
Ok that's make sens !
I recommend using the V2 but there are a lot of breaking change. But if your are new in react-native the V2 will help you a lot.
By the way in App/Config you have to have a index.js file, this will be the file used for environment variables. So event if you have a index.dev.js you can copy paste index.staging.js into a index.js file. This will resolve your issue
from react-native-boilerplate.
Hi Jeremy thanks for your support.
I did rename index.staging.js to index.js but still the issue persists.
Here is the full output from Metro window.
error: bundling failed: Error: While resolving module
App/Config, the Haste package
Appwas found. However the module
Config` could not be found within the package. Indeed, none of these files exist:
D:\PR-BBX_Projects\BookBoxApp\App\Config(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
D:\PR-BBX_Projects\BookBoxApp\App\Config\index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
at resolveHasteName (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro-resolver\src\resolve.js:236:9)
at Object.resolve (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro-resolver\src\resolve.js:103:20)
at ModuleResolver.resolveDependency (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:143:31)
at ResolutionRequest.resolveDependency (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\node-haste\DependencyGraph.js:283:16)
at Object.resolve (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\lib\transformHelpers.js:261:42)
at D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:399:31
at Array.map ()
at resolveDependencies (D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:396:18)
at D:\PR-BBX_Projects\BookBoxApp\node_modules\metro\src\DeltaBundler\traverseDependencies.js:269:33
DELTA [android, dev] ....../index.js ▓▓▓▓▓░░░░░░░░░░░ 35.4% (631/1105), failed.`
How do I go about fixing this?
from react-native-boilerplate.
Please let me know if the file App/Config/index.js
exists. If yes try to close the metro bundle and restart it using yarn start --reset-cache
from react-native-boilerplate.
Hi,
As per your advice, I have copied the index.staging.js as index.js in that location App/Config/index.js.
Index.js has the following lines.
export const Config = { API_URL: 'https://jsonplaceholder.typicode.com/users/', }
And I did start the metro bundler in another cmd window with admin access with yarn as you have told. but it gives the same problem! (multiple times I tried the reset cache command)
One slight improvement is that it fails at 44.4% instead of previous 35.4. ;)
Anything else I'm missing?
from react-native-boilerplate.
Hello Jeremy,
any updates on my issue?
Thanks for your time.
from react-native-boilerplate.
Can you share me your code it will be easier for me.
from react-native-boilerplate.
By code do you mean the full project directory or a certain .js file like App.js, index.js etc?
from react-native-boilerplate.
Yes the whole project please !
from react-native-boilerplate.
Sure Jeremy, is there an email to which I can send the link to?
from react-native-boilerplate.
Sure ! Hope we will make it work 😉 [email protected]
from react-native-boilerplate.
Related Issues (20)
- In Window "cp" command will not work while install [BUG]: HOT 2
- [Help Wanted] Redux store best practices HOT 1
- V4 HOT 4
- [NEW FEATURE REQUEST/IDEA]: Support for npm or specify yarn as prerequisite HOT 3
- SSL pinning HOT 2
- [Help]: Material Top Tabs Navigator Doesn't Work HOT 3
- [NEW FEATURE REQUEST/IDEA]: How To handle deep link in this structure HOT 1
- [BUG]: Crash when debug android app HOT 5
- [BUG]: cannot run android HOT 4
- [BUG]: Got Type Errror at NativeWebSocketModule.connect when: Show Element Inspector => Choose Network tab HOT 2
- [BUG]: Windows init projet HOT 3
- [NEW FEATURE REQUEST/IDEA]: Update version react native 0.73
- Add the Beta build page again HOT 1
- [BUG]: Failed run project HOT 5
- [NEW FEATURE REQUEST/IDEA][v4.0.0]: How about if there is an option for enable redux when create new project HOT 1
- [BUG]: Error when create new project HOT 4
- version selection HOT 1
- Application is not running in android(adb). HOT 7
- [BUG]: not able to open this url "https://thecodingmachine.github.io/react-native-boilerplate/docs/BetaBuild/" HOT 3
- Adding a Q&A section to the documentation HOT 1
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 react-native-boilerplate.