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

Cannot find module './init/init' after upgrade to 57.5 #22292

Closed
rmilejcz opened this issue Nov 15, 2018 · 2 comments
Closed

Cannot find module './init/init' after upgrade to 57.5 #22292

rmilejcz opened this issue Nov 15, 2018 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@rmilejcz
Copy link

Environment

React Native Environment Info:
System:
OS: macOS 10.14.1
CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 69.88 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.1.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
Build Tools: 26.0.3, 27.0.3, 28.0.3
API Levels: 26, 27, 28
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.7.0-alpha => 16.6.1
react-native: 0.57.5 => 0.57.5

Description

After upgrading to react-native 0.57.5 I began to get this error when running react-native start:

internal/modules/cjs/loader.js:589
    throw err;
    ^

Error: Cannot find module './init/init'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
    at Function.Module._load (internal/modules/cjs/loader.js:513:25)
    at Module.require (internal/modules/cjs/loader.js:643:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/robertmilejczak/Documents/Projects/kalos-mobile/node_modules/react-native/local-cli/cliEntry.js:26:14)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Module._compile (/Users/robertmilejczak/Documents/Projects/kalos-mobile/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Object.newLoader (/Users/robertmilejczak/Documents/Projects/kalos-mobile/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:605:32)

And if I try building in XCode I get a message that YogaEnums.h could not be found.

Reproducible Demo

Unfortunately I cannot reproduce this consistently. It happens on my local machine with each restart, and sometimes happens if I have to restart metro during testing for some reason.

The fix is easy enough, I just clear all my caches and reinstall node_modules and everything works fine so realistically it's just a delay of a few minutes.

As far as I can tell this is not happening on fresh projects so I'm guessing there was some change to some core iOS file that I did not get since I did not use react-native upgrade. Since rn-diff has not been able to keep up with the rn release schedule I can't confirm whether or not this is the case. I don't actually need assistance, and am only making this issue for posterity.

@thymikee
Copy link
Contributor

It looks like an issue with this particular install. If reinstalling stuff with e.g. yarn --check-files helps, I think it's better to close this to not pollute the issue tracker.

@rmilejcz
Copy link
Author

@thymikee I actually meant to close the issue initially, since I already have a fix in place. I'll do that now

When you say with this particular install, how do you mean? I've been using this react-native install since 0.57.1 and have been upgrading regularly, this issue has only been introduced after upgrading to 0.57.5

@facebook facebook locked as resolved and limited conversation to collaborators Nov 15, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants