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

error: bundling failed: Error: Unable to resolve module `./navigators/createContainedStackNavigator` #4895

Closed
dwisetiyadi opened this issue Aug 24, 2018 · 15 comments

Comments

@dwisetiyadi
Copy link

commented Aug 24, 2018

Unable to resolve module ./navigators/createContainedStackNavigator

Can not run when run
react-native ios


Current Behavior

when run
react-native run-ios

i have this error message:

error: bundling failed: Error: Unable to resolve module ./navigators/createContainedStackNavigator from ~/node_modules/react-navigation/src/react-navigation.js: The module ./navigators/createContainedStackNavigator could not be found from ~/node_modules/react-navigation/src/react-navigation.js. Indeed, none of these files exist:

Expected Behavior

Should run my app on iOS Simulator

How to reproduce

  • npm i --save react-navigation
  • react-native run-ios

My Environment

software version
react-navigation 2.12.1
react-native 0.56.0
node v10.9.0
npm or yarn 6.2.0
@brentvatne

This comment has been minimized.

Copy link
Member

commented Aug 24, 2018

hello i suggest deleting node_modules, deleting your lock files, and running npm install again. if that doesn't fix it, please share a reproducible example

@brentvatne brentvatne closed this Aug 24, 2018
@dwisetiyadi

This comment has been minimized.

Copy link
Author

commented Aug 24, 2018

@raffij

This comment has been minimized.

Copy link

commented Aug 25, 2018

@dwisetiyadi it's to do with the new version refactoring the StackNavigator require.

Removing node_modules, deleting app and closing the build console didn't help.

I needed to reset the react-native cache npm start -- --reset-cache

@GunnarAK

This comment has been minimized.

Copy link

commented Oct 16, 2018

Performing npm start -- --reset-cache on its own did not do the trick for me.

But performing the following did succeed:

  1. Delete node_modules & package-lock.json
  2. Delete app from phone
  3. run npm start -- --reset-cache
  4. run app
@laurentsmohr

This comment has been minimized.

Copy link

commented Dec 2, 2018

@GunnarAK how does your npm start script look like?

@beckinfonet

This comment has been minimized.

Copy link

commented Dec 12, 2018

Performing npm start -- --reset-cache on its own did not do the trick for me.

But performing the following did succeed:

  1. Delete node_modules & package-lock.json
  2. Delete app from phone
  3. run npm start -- --reset-cache
  4. run app

Thanks man, fixed it!

@kunalshah4345

This comment has been minimized.

Copy link

commented Dec 24, 2018

change version of react-navigation to 1.6.1 in package.json file
Delete node_modules & package-lock.json
Delete app from phone
run npm start -- --reset-cache
run app

@JGeraldoLima

This comment has been minimized.

Copy link

commented Jan 17, 2019

I can confirm that only removing node_modules path does solve the problem.

If you're getting an error with pattern error: bundling failed: Error: Unable to resolve module '<lib>' from '<lib file>': Module '<module>' does not exist in the Haste module map, check you react and react-native versions or the last added lib on package.json, maybe some of them are crashed.

BUT, if someone of your team are not getting this error, maybe it is a cache problem. Just follow @GunnarAK tips and save your life, like I did. Thank you so much @GunnarAK!

@GunnarAK

This comment has been minimized.

Copy link

commented Jan 18, 2019

@laurentsmohr I will have a look at this shortly

@GunnarAK

This comment has been minimized.

Copy link

commented Jan 18, 2019

@laurentsmohr Here it is:

"start": "react-native start",

@jdevey

This comment has been minimized.

Copy link

commented Jan 27, 2019

I scoured the internet for at least six hours trying to find a solution to this problem, and none of them worked. Not even a little bit.

At one point I was so desperate I started renaming some directories, and out of dumb luck I found that changing a directory with a capitalized name to a lower-case name fixed the issue. I'm not entirely sure why this fixed it, but I suspect it may have to do with npm.

TL;DR change the imports that are giving you issues so the directory names are lower-case.

@GunnarAK

This comment has been minimized.

Copy link

commented Jan 27, 2019

From the docs (found at https://github.com/nwjs/nw.js/wiki/Manifest-format#name)

(string) the name of the package. This must be a unique, lowercase alpha-numeric name without spaces. It may include "." or "_" or "-" characters. It is otherwise opaque.

name should be globally unique since node-webkit will store app's data under the directory named name.
@shayanaithal

This comment has been minimized.

Copy link

commented Feb 7, 2019

screenshot from 2019-02-07 12-00-58
i tryd everything still getting this error

@us-22

This comment has been minimized.

Copy link

commented May 31, 2019

+1

I'm facing the same issue? any luck resolving it?

@jameskip

This comment has been minimized.

Copy link

commented Jul 22, 2019

I am using Yarn and was unable to reproduce the above solutions. I was able to resolve this error by running:

yarn cache clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.