question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: global.nativeTraceBeginSection is not a function (Systrace)

See original GitHub issue

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

Yes

Environment

  1. react-native -v: react-native-cli: 2.0.1, react-native: 0.46.1
  2. node -v: v7.10.0
  3. npm -v: 4.6.1
  4. yarn --version (if you use Yarn): Not used in this bug

Then, specify:

  • Target Platform: iOS

  • Development Operating System: macOS Sierra v 10.12

  • Build tools: Xcode Version 8.3.3 (8E3004b)

I’m running react-native run-ios deploying to iOS emulator Version 10.0 (SimulatorApp-745.10), running iOS 10.3 in an iphone 6.

Steps to Reproduce

(Write your steps here:)

  1. Run react-native run-ios with Systrace enabled
dev_menu
  1. Reload your app (manually or with live/hot reload)

  2. Check the logs

Expected Behavior

The app should reload normally.

Actual Behavior

The error TypeError:global.nativeTraceBeginSection gets launched into the console:

console_error

And in the UI:

ui_error

After that, the whole emulator crashes and the only way to restore it is running react-native run-ios again. One temporary workaround to get rid of this error is disabling Systrace in the DevMenu, but this is less than ideal.

Reproducible Demo

https://snack.expo.io/ryCtYZHrZ

Observation: Even though I included a snack, I’m afraid you can’t fully reproduce this problem without a Mac and an iOS emulator, the reason being that the Systrace is not an Expo function.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:46
  • Comments:70 (36 by maintainers)

github_iconTop GitHub Comments

31reactions
GuoZhiQiangcommented, Aug 17, 2018

Following steps help me:

  • Press Cmd+D (or shake the device )to show the Dev menu.
  • Select Stop Systrace option.
  • Restart the app.
22reactions
gaearoncommented, Dec 12, 2017

I’ve brought it up internally, and there’s a person who planned to look into fixing this either in December on January. If it’s not fixed by the end of January please ping me in person (e.g. on Twitter DM) and I’ll try to see what’s the status on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: global.nativeTraceBeginSection is not a function
I was getting the error. What worked for me was just disabling Start Systrace and restarting the project. How I do that? Command...
Read more >
global.nativeTraceBeginSection is not a function (Systrace)
TypeError : global.nativeTraceBeginSection is not a function (Systrace)
Read more >
[Solved]-Error: global.nativeTraceBeginSection is not a function
I had the same issue because I unintentionally enabled Start Systrace and since it is a known react native issue... I was getting...
Read more >
error typeerror: labels.slice is not a function - You.com | The AI ...
The app should reload normally. Actual Behavior. The error TypeError:global.nativeTraceBeginSection gets launched into the console: console_error. And in the UI ...
Read more >
https://raw.githubusercontent.com/hubcarl/smart-re...
function '){ throw new TypeError( 'In this environment the target of assign MUST be an object.'+ 'This error is a performance optimization and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found