Skip to content

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

@rmilejcz

Description

@rmilejcz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions