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

Unable to resolve module with react-native 0.57 #21922

Closed
3 tasks
pronebird opened this issue Oct 24, 2018 · 3 comments
Closed
3 tasks

Unable to resolve module with react-native 0.57 #21922

pronebird opened this issue Oct 24, 2018 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@pronebird
Copy link

pronebird commented Oct 24, 2018

Environment

React-native CLI is running at:  /Users/pronebird/app/

  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
      Memory: 27.06 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.12.0 - /usr/local/Cellar/node/10.12.0/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild

Description

Looking for JS files in
   /Users/pronebird/app/packages/mobile
   /Users/pronebird/app/packages/mobile/node_modules
   /Users/pronebird/app/node_modules
   /Users/pronebird/app/packages/components 

Loading dependency graph, done.
 BUNDLE  [ios, dev] ../../packages/mobile/index.js ▓▓▓▓░░░░░░░░░░░░ 26.1% (329/6
44)::1 - - [24/Oct/2018:11:46:54 +0000] "GET /index.bundle?platform=ios&dev=trueerror: bundling failed: Error: Unable to resolve module `scheduler/tracing` from `/Users/pronebird/app/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js`: Module `scheduler/tracing` does not exist in the Haste module map

Config:

const path = require('path');

console.log('React-native CLI is running at: ', __dirname);

module.exports = {
  projectRoot: path.resolve(__dirname, 'packages/mobile'),
  watchFolders: [
    path.resolve(__dirname, 'packages/mobile/node_modules'),
    path.resolve(__dirname, 'node_modules'),
    path.resolve(__dirname, 'packages/components/'),
  ]
}

Running with:

yarn workspace mobile-app ios

which basically runs:

react-native run-ios --simulator

The config from v0.56 which worked!:

const path = require('path');

console.log('React-native CLI is running at: ', __dirname);

module.exports = {
  getProjectRoots() {
    return [
      path.resolve(__dirname, 'packages/mobile'),
      path.resolve(__dirname, 'packages/components/'),
      path.resolve(__dirname, 'packages/mobile/node_modules'),
      path.resolve(__dirname, 'node_modules'),
    ];
  }
}

Because yarn and react-native are both buggy I also symlink node_modules/react-native -> packages/mobile/node_modules/react-native to make that work together.

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

@react-native-bot react-native-bot added the Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. label Oct 24, 2018
@rajivshah3
Copy link
Contributor

This might be related to facebook/react#13641 (comment)

@VLZH
Copy link

VLZH commented Dec 17, 2018

Metro config file changed it's format
So.. #20969 (comment)

@kelset
Copy link
Contributor

kelset commented Dec 18, 2018

As mentioned by @VLZH yeah, on 0.57.x the format for metro config changed. You can find more details here

@kelset kelset closed this as completed Dec 18, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Dec 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 18, 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. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

No branches or pull requests

5 participants