react-native: Unable to resolve module `schedule/tracking`
Environment
React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i7-7700HQ CPU @ 2.80GHz Memory: 536.34 MB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 8.11.4 - ~/.nodenv/versions/8.11.4/bin/node npm: 5.6.0 - ~/.nodenv/versions/8.11.4/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3 IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild npmPackages: react: 16.4.1 => 16.4.1 react-native: ^0.57.0 => 0.57.0 npmGlobalPackages: react-native-cli: 2.0.1
Description
After updating to RN 0.57.0, I get
error: bundling failed: Error: Unable to resolve module `schedule/tracking`
Looking for JS files in
/Users/khoa/XcodeProject2/myapp
warning: the transform cache was reset.
Loading dependency graph, done.
error: bundling failed: Error: Unable to resolve module `schedule/tracking` from `/Users/khoa/XcodeProject2/myapp/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js`: Module `schedule/tracking` 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-*`.
at ModuleResolver.resolveDependency (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
at ResolutionRequest.resolveDependency (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
at DependencyGraph.resolveDependency (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
at Object.resolve (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/lib/transformHelpers.js:180:25)
at dependencies.map.result (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
at Array.map (<anonymous>)
at resolveDependencies (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
at /Users/khoa/XcodeProject2/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
at Generator.next (<anonymous>)
at step (/Users/khoa/XcodeProject2/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)
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
Right now I need to switch back to 0.56.0 for it to work again. Also, on 0.57.0 I get https://github.com/facebook/react-native/issues/21094
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 42
- Comments: 35 (3 by maintainers)
Commits related to this issue
- Fix for react-native bug https://github.com/facebook/react-native/issues/21150 — committed to balance-io/balance-wallet by mikedemarais 6 years ago
- Fix for react-native bug https://github.com/facebook/react-native/issues/21150 — committed to balance-io/balance-wallet by mikedemarais 6 years ago
After several hours spent on a huge
0.55
->0.57
RN migration, I think it’s a RN incompatibility with React 16.5.2. As you can see in React’s changelog and in React Native’s sourceschedule/tracking
has been changed toschedule/tracing
and React Native uses the old name. I don’t know why naming change landed in a minor version update. Switching back to React 16.5.1 can do the job too.I solved this by installing the previous version of the schedule package:
Hey 👋 So, now RN
0.57.3
is out which means that this is fixed, BUT you NEED to upgradereact
andreact-test-renderer
to version"16.6.0-alpha.8af6728"
.It’s safe, I’ve tested 0.57.3 in multiple apps without issues these past few hours. (if you prefer to not, you can wait for future 0.57.x releases, 16.6.0 will be most likely released in a couple weeks at ReactConf).
I know it’s not ideal, but, again, I tested and hit no walls.
Quick update on this: a commit from the internal FB codebase is going to land soon (next couple days) and will sync the React deps (similar to this commit).
So hold on, a fix will be there soon.
👋 everyone, thanks for reporting - we’ll try to have a look at it asap!
In particular thanks @krzysztof-miemiec for the details
I have the same problem, and tried
npm i schedule@0.4.0 --save-dev
then it worked.As @krzysztof-miemiec mentioned, releases are tested. And there are reasons if we have rc phases and then we keep releasing minor versions.
That said, update on this issue, a commit finally landed on master this weekend - and it will enabled usage of React 16.5.2 -> https://github.com/facebook/react-native/commit/7142e9b1c5f95e82ceb04798b166318385004147
I am on React 16.3.2 & RN0.57, still facing the same error. Trying to update to React 16.5.1 didn’t work either… 😦
I tried and it worked:
Looks like it works with
yarn add schedule@0.4.0 --dev
(ornpm i schedule@0.4.0 --save-dev
) but it doesn’t withschedule@0.5.0
I also had to
yarn add @babel/runtime@7.0.0 --dev
@ithustle Read the comments! kelset’s answer
@kelset whats the reason for syncing with 16.6.0-alpha instead of 16.5.2?
I was able to get things working by installing
@babel/runtime
andschedule@0.4.0
, thanks to everyone’s comments on this issue.Upgrading to RN 0.57.1 I receive the following error:
In my dependencies I’ve then added
@babel/runtime
That error disappears but then I have another one:
Using an older version of react package (16.5.1), as suggested by @krzysztof-miemiec, the error still appears.
My
package.json
is the following:@hkung77 After update/downgrade of React/React Native I usually run into issues because of
yarn.lock
stuck with different version number for some specific dependencies. You can try removing that file, cleaningnode_modules
and rebuilding everything. I made a handypurge
command in my project’spackage.json
for clean+install+prepare:The
prepare
part is for automatic asset (app icons) generation andpod install
done by Fastlane plugins.My bad, thanks @pistou and @kelset
Guys, I update RN to 0.57.3 with schedule 0.4.0 (installed before) and React 16.5.2 and doesn’t work.
Any help?
Guys, I’m on
react-native
0.57.3 and installingscheduler
resolved my problemit would be great if new releases of react-native were tested - the number of issues when upgrading is unbelievable
@krzysztof-miemiec thanks! Downgrading to react 16.5.1 worked for me! Haven’t tried the other options.
it seems schedule 0.5.0 package error, thanks @stafak
Yes it’s very advisable to stick with the react version that each react-native version recommends in the package.json.
Hi all, this is my
package.json
and it works for me 😉@danilobuerger https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md
@krzysztof-miemiec I deleted my my node_modules and removed the package-lock, before I do a fresh npm install. But still the same issue