GithubHelp home page GithubHelp logo

Comments (17)

AurelGit avatar AurelGit commented on April 27, 2024 1

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.

merajcal avatar merajcal commented on April 27, 2024 1

Sorry, My bad. Just realized. Thanks

from react-native-boilerplate.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

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.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

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.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

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.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

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.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

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.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

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.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

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 moduleConfig` 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.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

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.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

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.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

Hello Jeremy,
any updates on my issue?
Thanks for your time.

from react-native-boilerplate.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

Can you share me your code it will be easier for me.

from react-native-boilerplate.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

By code do you mean the full project directory or a certain .js file like App.js, index.js etc?

from react-native-boilerplate.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

Yes the whole project please !

from react-native-boilerplate.

arvind-bookbox avatar arvind-bookbox commented on April 27, 2024

Sure Jeremy, is there an email to which I can send the link to?

from react-native-boilerplate.

JeremyDolle avatar JeremyDolle commented on April 27, 2024

Sure ! Hope we will make it work 😉 [email protected]

from react-native-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.