November 11, 2020 · Expo React Native

Expo Stuck on Splash Screen

You know when you've been so productive, but then you suddenly run into some really obscure bug that no one knows how to fix? Well today was one of those days. I've been using Expo lately and I wanted to get acquainted with React Navigation. It was working fine until I installed a package and removed it. At that point I was getting errors like such:

Unable to symbolicate stack trace: The stack is null

So I thought maybe there was some caching weirdness going on with Expo, so I tried clearing the bundler cache, but that didn't work. I tried to drop my node_modules folder and npm install everything again. That didn't work. I thought maybe my Expo app had some cache too. I deleted it and reinstalled it. Perhaps the remote debugger was being weird, so I disabled that. NO DICE.

So I started Googling to see what others have done. They said to run expo start --no-dev --minify. Same behavior. Someone said to uninstall the splash screen module. So I did a global search for it and found that it was referenced in the yarn lock file. I tried to uninstall it, but yarn complained about the following:

Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).

I've never seen the error before and I didn't know what Yarn Workspaces were, so I did some more googling that got me to this Stack Overflow page: https://stackoverflow.com/questions/51235261/why-does-yarn-warn-when-adding-a-dependency-to-the-root-workspaces-package-json

After reading one of the answers I had a hunch at what was going on. Basically Yarn Workspaces allow you to install packages for multiple package.json's under one root workspace path with just one yarn install command and it'll resolve dependencies so that they aren't duplicated. So instead of running npm install under multiple paths, you just do it in the project root.

To confirm that I had Yarn Workspaces I checked my package.json. Low and behold I found this line...

  "workspaces": {
    "packages": [
      "packages/*",
      "example"
    ]
  },

And it all made sense. I had the following path structure.

project-root/
-- node_modules
-- example
---- node_modules
---- package.json
---- package-lock.json (here because I ran npm install at this path)
-- package.json
-- yarn.lock

After dropping the all the node_modules folders in the project and running yarn install in the root my app was running fine again.

Solving A Bug That's Never Been Solved Before

So my two biggest clues from all of this was when exactly did my application stop working? When I removed the package.

What was its current behavior and how did that differ to its past and in relation to other apps? Expo, didn't show the Running application on iPhone. message in the terminal. It only got as far as compiling the JavaScript bundle.

Those were the two biggest clues that let me to figure this all out.

The Core Issue?

Basically my dependencies were not in sync and Expo was failing silently.

Subscribe by Email

Get my latest content straight to your email

    We won't send you spam. Unsubscribe at any time.
    Powered By ConvertKit

    Liked this article? Share it on your favorite platform.

    • LinkedIn
    • Tumblr
    • Reddit
    • Google+
    • Pinterest
    • Pocket
    If you have any questions about this article