Cannot access 'authRows' before initialization is what our companion popup threw on 29 September 2026, and it threw it at the top level of the script. A ReferenceError there does not break one feature. It stops the script at the line that threw, so nothing written below that line ever runs. In our case that meant no tools panel, no notes wiring and a blank page every time anyone opened the popup in full screen, from any tab. Every check we had that parsed the file stayed green, because the file was fine as text.
What "cannot access before initialization" means at the top level
let, const and class bindings exist from the start of their scope, but they cannot be read until the line that declares them has run. The stretch in between is the temporal dead zone. Reading a binding inside it throws, where an old var would have handed back undefined and carried on.
Function declarations are different: they are hoisted whole, so you can call one from the top of a file. That is exactly what makes this bug easy to write. The call works. The function starts running. Then it reaches for a const that sits a few hundred lines further down and has not been evaluated yet, and the throw comes from inside a function that was perfectly legal to call.
How it happened in our popup
The companion is the extension that runs inside every Mosaic profile, with the profile's notes, saved logins and, since that day, an Auth panel of two-factor codes. Its popup reads a tab= query to decide which panel to open first. That decision sat near the top of popup.js:
const QUERY = new URLSearchParams(location.search)
// ...
if (QUERY.get('tab')) showPanel(QUERY.get('tab'))
showPanel reaches into the panel it opens. The new Auth panel's code timer lives beside const authRows, several hundred lines below. So the call ran, showPanel touched authRows, and the engine threw before the rest of the file had been evaluated.
The part that made it total is the full-screen button. It opens popup.html?full=1&tab=<panel>, so in full screen the tab= query is always present and the branch is always taken. Full screen was not broken on the Auth tab. It was broken on every tab, because whichever panel you came from, the startup code ran before the bindings existed.
The small popup, opened from the toolbar, has no query and never took the branch. That is how a page could be dead in one window and fine in the other.
The fingerprint is changed inside the engine, not painted on topIn Mosaic: Fingerprints set inside the browser. Tesseract Chrome: values set inside, not by a script. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.
Mosaic is a desktop app
Email yourself the link and open it on your computer.
How it works: Fingerprints set inside the browser
Why nothing reported it
There was no red mark anywhere we looked. A popup's console belongs to the popup, and nobody opens DevTools on an extension popup to see why it is empty. The build had a check that the companion's files parse in every configuration, and they did. A parse answers "is this JavaScript", and this was JavaScript. Whether it throws depends on what runs first, and that only shows when something runs it.
We found it by driving the popup over the Chrome DevTools Protocol and reading what it actually did, which is how every fault in that panel was found. The same rule shows up in the geolocation spoof that answered once: the test that matters is running the thing the way a person does, not reading it.
The fix, and the check that holds it
The panel choice now runs last, after every top-level declaration it could close over. Running it from DOMContentLoaded would also have worked, because a classic script finishes evaluating before that event fires. We moved the call, and a comment above it now says it is the last line of the script on purpose.
The check was harder to write than the fix. check:companion now finds the line that reads QUERY.get('tab') and lists every const declared at column 0 below it. A const at column 0 is module scope; anything indented is inside a function and will exist by the time a handler runs. Any name on that list fails the build:
popup.js chooses a panel before 6 top-level bindings exist (...)
— that throws and kills the rest of the script
We put the fault back to see it fire, and it named six bindings. A check that has never failed is not evidence of anything, so that run is part of the check.
The same error, once more, in a test runner
This was not the first time a dead-zone read cost us. Our detection suite once ran, drove six detectors, wrote its report, cleaned up its profile and exited 0. Every row in the report said error Cannot access 'environment' before initialization. A let environment had been declared under the report heading, two hundred lines below the loop that passed it on. It threw for every test in every run.
A run where every row is our own exception describes our script, not the browser it was pointed at. The runner now groups errors by message, says so in plain words when every row failed, and exits with a non-zero code. A retired detector that answers 200 is the same trap from the other side: a run that finished is not a run that measured anything. And running 49 fingerprint tests unattended has the rest of what that runner had to learn.
If you hit this error
- Read the name in the message. It is the binding, not the function that touched it.
- Find the first top-level statement that calls into code using that binding. That call is the problem, not the declaration.
- Move the call below the last declaration it can reach, or start it from
DOMContentLoaded. - Look for every way the call gets reached. Ours depended on a query string only one button sent.
- Run the page, not a parser. A syntax check cannot see an error that depends on order.
The companion is one of the pieces described in introducing Mosaic, and since September its full-screen view opens on whichever tab you left.
Sources
- MDN: ReferenceError: can't access lexical declaration 'X' before initialization, read November 3, 2026






