Skip to content

Instantly share code, notes, and snippets.

@brentvatne
Created September 17, 2017 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentvatne/00407710a854627aa021fdf90490b958 to your computer and use it in GitHub Desktop.
Save brentvatne/00407710a854627aa021fdf90490b958 to your computer and use it in GitHub Desktop.

Problem 1

Errors that happen when you first start the app aren't handled gracefully

  • Inside of an async function for loading assets
    • if you have an error in your asset loading, using the current template you'll get an error about space-mono (or if you don't use that, whatever other font you use) not being found or an unhandled promise rejection. this fix adds a method to AppLoading called startAsync so we can handle errors for people. you don't have to use it, old method works still.
Red screen first If they dismiss, they see this instead of loading screen
  • On initial render
    • if you initial render throws an error, you will get a screen screen and then when you dismiss it you just see the loading screen. this fix hides the loading screen and shows you a message to indicate what happened
Red screen first If they dismiss, they see this instead of loading screen

Problem 2

Errors that go through our logging via expo-sdk / xdl don't include stacktraces

  • Unhandled promise rejections

screen shot 2017-08-30 at 9 20 14 pm

  • Any error that is logged

screen shot 2017-08-31 at 1 20 51 pm

Also, if you do console.warn or console.error and one of the arguments is an error object, we just pretty print the error object and don't show the trace. The trace that is shown instead shows where the warning / error comes from.

screen shot 2017-08-31 at 1 20 57 pm

  • Any console.warn or console.error includes context via stacktrace

screen shot 2017-08-30 at 3 16 12 pm

  • Collapsable stacks in XDE

screen shot 2017-08-30 at 7 02 04 pm

TODO

  • Need to figure out how I can know whether app has "loaded" or not -- if there is AppLoading has it been dismissed? If not, how can we know that it is not being used?
  • Update AppLoading docs, recommend to use startAsync
  • Clean up paths (should be relative to project root)
  • Format stack for XDE
  • XDE: linkify files in stack frame to open in EXPO_EDITOR on click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment