Repository navigation
Render the K2 dashboard on GitHub's React repository page - #391
Merged
Merged
Conversation
GitHub's repository homepage no longer has .repository-content, so the dashboard passed undefined to createRoot and crashed with React error #299. Render into #ui-service-main-content when .repository-content is missing and draw the K2 pages again when GitHub rebuilds the body and drops the K2 tab.
GitHub's repository page renders everything below the tabs in #ui-service-main-content, so the dashboard only looks for that container.
tgolen
approved these changes
Oct 1, 2026
Comment on lines
+11
to
+12
| let host = null; | ||
| let root = null; |
Contributor
There was a problem hiding this comment.
NAB: These variable names are confusing. I'd prefer more verbose and intuitive names.
Contributor
|
🚀 Released in version 1.5.68 🚀 |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The K2 dashboard no longer loads. https://github.com/Expensify/Expensify#k2 shows GitHub's file view, and the console shows
Uncaught (in promise) Error: Minified React error #299, which iscreateRoot(...): Target container is not a DOM element.Cause
GitHub moved the repository homepage to its React UI. The page has no
.repository-contentanymore. Everything below the repository tabs now lives in<main id="ui-service-main-content">, and its children are a React tree with hashed Primer class names.src/js/module/dashboard/index.jsappended.k2dashboardto.repository-content. With no container, the append did nothing andcreateRootreceivedundefined. The call runs in the Onyx preferences callback, so the error surfaced as an unhandled promise rejection.Fixing that exposed a second problem. About a second after the page loads, GitHub rebuilds parts of
bodyoutside its React tree. That removes the K2 tab, whichall.jsappends tobody, and clearsk2-page-activefrombody. K2 never drew itself again, so the dashboard showed for a moment and then GitHub's file view came back.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/687575
Tests
npm run buildand loaddist/as an unpacked extension.