Skip to content

[0.60.x] warnOnce error in new 0.60.x project created with react-native-cli #25552

@c4ss

Description

@c4ss

React Native version:

$ react-native info
info Fetching system and libraries information...
System:
    OS: Linux 4.18 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 1.58 GB / 15.39 GB
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.16.0 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.0 => 0.60.0

Steps To Reproduce

  1. yarn global add react-native-cli
  2. react-native init testproject --version 0.60.0
  3. cd testproject && react-native run-android
  4. Project builds, but bundler doesn't stay open
BUILD SUCCESSFUL in 7s
27 actionable tasks: 26 executed, 1 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.testproject/.MainActivity }
user@computer:~/Documents/testproject$ 
  1. yarn run metro build index.js -O index.android.bundle
Error: Unable to resolve module `warnOnce` from `/home/rob/Documents/testproject/node_modules/react-native/Libraries/react-native/react-native-implementation.js`: Module `warnOnce` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.

Describe what you expected to happen:
Project builds without error

Snack, code example, or link to a repository:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPlatform: LinuxBuilding on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.💻CLI

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions