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

Problem with scheduler/tracing #23781

Closed
deecewan opened this issue Mar 6, 2019 · 10 comments
Closed

Problem with scheduler/tracing #23781

deecewan opened this issue Mar 6, 2019 · 10 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@deecewan
Copy link
Contributor

deecewan commented Mar 6, 2019

🐛 Bug Report

I have started to get an error from ReactNativeRenderer-dev.js.

It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling

<unknown>
    ReactNativeRenderer-dev.js:15147:2
<unknown>
    ReactNativeRenderer-dev.js:16:2
loadModuleImplementation
    require.js:320:4
guardedLoadModule
    require.js:207:11
metroRequire
    require.js:127:6
<unknown>
    ReactNative.js:18:16
loadModuleImplementation
    require.js:320:4
guardedLoadModule
    require.js:207:11
metroRequire
    require.js:127:6

To Reproduce

I have really no idea what caused this. I have tried everything. I'm running only one version of scheduler (as confirmed by yarn.lock). I can't see anywhere that the profiling schedule would be enabled, looking through the compiled source.

enableSchedulerTracing is set to true in ReactNativeRenderer-dev.js, which causes the invariant to run, and fails.
This happens straight away when the application starts. I have seen it before, but it fixed with remove node_modules and re-installing.

I have wiped + reinstalled (after clearing the Yarn cache). Still broken. I am so so lost. I've spent about 5 solid hours now trying to fix this.

Expected Behavior

The app doesn't die when starting.

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.1
      CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
      Memory: 1.10 GB / 32.00 GB
      Shell: 5.5.1 - /usr/local/bin/zsh
    Binaries:
      Node: 10.9.0 - /var/folders/1d/tp8ckm_52hx1xv7zdjqsrw1h0000gn/T/yarn--1551849609863-0.0831478050093859/node
      Yarn: 1.13.0 - /var/folders/1d/tp8ckm_52hx1xv7zdjqsrw1h0000gn/T/yarn--1551849609863-0.0831478050093859/yarn
      npm: 6.2.0 - ~/.nvm/versions/node/v10.9.0/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: 23.0.1, 23.0.3, 25.0.1, 25.0.3, 26.0.1, 26.0.2, 27.0.3, 28.0.2, 28.0.3
        API Levels: 23, 24, 25, 26, 27, 28
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: ^0.58.6 => 0.58.6
@dulmandakh
Copy link
Contributor

@deecewan do you see the issue on both iOS and Android?

@deecewan
Copy link
Contributor Author

@dulmandakh as far as i remember, yes. I mostly work with it on iOS. I managed to get it fixed, but I have no idea what steps I took to get it to fix.

@rickhanlonii
Copy link
Member

Hey @deecewan, glad to hear this is fixed for you

This is a React error from a mismatch between the renderer and scheduler when using the profiler - my best guess is that you were using the react-dom profiler before the update, without the scheduler set up, and after the upgrade this switched to an error

The fix was probably to add something like 'scheduler/tracing': 'scheduler/tracing-profiling', to your config

See here for more info

@deecewan
Copy link
Contributor Author

@rickhanlonii this just happened to me again. I have not used the profiler at all (I probably should, but that's a different story). I managed to fix it this time by closing the simulator, clearing the RN cache, and starting again.

I am still really unsure how or why this comes up. As I mentioned, I've never once used the profiling scheduler. The ReactNativeRenderer-dev has enableSchedulerTracing set to true. I'm not sure if that makes a difference or not, tho.

@kuzzmi
Copy link

kuzzmi commented May 17, 2019

Same situation here. Using Expo if that makes any difference.

I've tried all sorts of things, clearing cache on all levels, restarting everything, nothing seems to help. I'm a bit lost here.

@deecewan any idea how you fixed that?

@jigz
Copy link

jigz commented May 21, 2019

Same here, why has this issue been closed without a solution.

@deecewan I'd like to know as well how you managed to fix it.

@deecewan
Copy link
Contributor Author

I have no idea how I fixed it - I imagine uninstalling the App from the iOS simulator, clearing the cache, removing node_modules. I'm really not sure.

I've now upgraded, and haven't seen the error for a while.

@kuzzmi
Copy link

kuzzmi commented Jun 27, 2019

I found a problem and a solution.

I use .env file to pass some environment variables. And the problem was that in some cases my NODE_ENV variable was set to production, but Expo was running in development mode.

So basically the solution is to align the bundler and renderer to use the same NODE_ENV mode.

@rajnishcoder
Copy link

Any update on this?, I'm not using any .env file

and tried almost everything
(upgrading and downgrading react, react-native, react-test-renderer and clearing cache)
but nothing works for me.

I'm using react-native: 0.59.10 because on v60 it crashed while launching the app on almost every physical device.

React Native Environment Info:
    System:
      OS: Linux 4.17 Fedora 28 (Workstation Edition) 28 (Workstation Edition)
      CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
      Shell: 4.4.23 - /bin/bash
    Binaries:
      Node: 10.9.0 - /usr/bin/node
      npm: 6.2.0 - /usr/bin/npm
    npmPackages:
      react: 16.3.1 => 16.3.1 
      react-native: 0.59.10 => 0.59.10 
    npmGlobalPackages:
      create-react-native-app: 2.0.2
      react-native-cli: 2.0.1

@edrichhans
Copy link

I found a problem and a solution.

I use .env file to pass some environment variables. And the problem was that in some cases my NODE_ENV variable was set to production, but Expo was running in development mode.

So basically the solution is to align the bundler and renderer to use the same NODE_ENV mode.

How do we do that? In my case, the error appeared when I set the NODE_ENV of my .env to production, but setting it back to development doesn't do anything anymore. I tried clearning cache and re-installing node_modules to not avail.

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

No branches or pull requests

8 participants