Troubleshooting
The screen rebuilds on launch, a bundle is refused, the build fails, or native looks different from web.
The screen rebuilds on launch (remounted)
Symptom: launch metrics show phase == .remounted instead of .adopted, and viewsCreatedOnAdopt is not 0.
Your app's first render on the device differed from the one baked at build time, so Octapus threw the snapshot away and rendered from scratch. The screen still works; you only lose the instant takeover. mismatch says where the two first diverged:
node count: frame 42, runtime 43
row 7: frame <span> parent 3, runtime <div> parent 3
row 12: text "3" vs "4"Common causes:
- Reading the time, a random number, or device state during the first render.
- Branching on something that is different on the device than during the build.
Render a stable placeholder first and fill the real value in from an effect (example). On iOS, the first-screen cache also re-bakes from the rebuilt screen, so a one-off mismatch fixes itself on the next launch.
A bundle is refused
Symptom: an .error event at launch and nothing drawn, or bundle.isSupported == false.
bundle.incompatibility says why. The bundle is missing its manifest.json, was built by a newer CLI than the app's Octapus supports, or was compiled for a different Hermes version. Rebuild it with the oct that matches the Octapus version in your app. See Shipping updates.
hermesc not found
Native targets need the Hermes compiler. Run pnpm hermes in the Octapus checkout, or point oct at a compiler with OCT_HERMESC=/path/to/hermesc or --hermesc.
src/App.tsrx must export a component
oct uses the App export, then the default export, then the first exported function. Export your root component under one of those.
Native looks different from web
Open the app in the dev tool and check the Native vs Web inspector. It lists each element's position and size on both sides and the difference. Differences usually come from:
- Web fonts.
@font-faceis skipped on native, so a font the browser downloads is not used there. Use fonts installed on the device. - CSS with no native effect. Pseudo-elements,
:hover-style states and CSS animations only apply in the browser (list). - Unsupported elements.
<img>is not drawn on native yet. - Platform branches. Code behind
import.meta.env.OCT_TARGETrenders differently on purpose.
Runaway JavaScript freezes the screen
Set timeLimitMs in OctapusView.Options and build with --hermesc-flags "-O -emit-async-break-check". A call that runs longer than the limit is stopped and reported as an error instead of blocking the app.