Fix RadioScanner crash: react-fast-marquee CJS interop shim#178
Merged
Conversation
…le marquee
react-fast-marquee ships CJS-only; Vite 8's rolldown optimizer re-exports the
raw CJS namespace as the default export, so the component arrived as
{__esModule, default} and React crashed RadioScanner with 'Element type is
invalid'. New ./marquee shim unwraps .default defensively (all interop
shapes). Tests mocked the module, which is how this slipped past the gates —
the shim has a real-render test now.
Also restores the per-title marquee layout that PR #177's merge clobbered,
and swaps the OFFLINE wrapper p->div (marquee renders block divs; div-in-p
is invalid HTML and React 19 errors on it).
Verified live: RadioScanner opens clean on a fresh vite dev server.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019NMS1V2keS3pTbWRemCd9o
|
✅ Playwright E2E — 1 passed · 0 failed · 0 flaky · 0 skipped |
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.
RadioScanner crashed on open with
Element type is invalid ... got: objectinNowPlayingList.Root cause: react-fast-marquee ships CJS-only (
main: dist/index.js, no exports map). Vite 8's rolldown dep optimizer emitsexport default require_dist()— the raw CJS namespace{__esModule, default: Marquee}— so the default import reaches React as an object, not a component. The unit tests mocked the module, which is exactly how this got past the gates on #177.Fix:
RadioScanner/marquee.tsshim that unwraps.defaultdefensively (correct under dev, build, and vitest interop shapes); both call sites import it. A real-render test (ResizeObserver stubbed) now exercises the actual package instead of a mock.p→div(the marquee renders block divs; div-in-p is invalid HTML and React 19 errors on it).Verified live on a fresh vite dev server: RadioScanner opens, marquees scroll, console clean of both the crash and the DOM-nesting error. Gates: tsc, eslint, 375 tests green.
🤖 Generated with Claude Code
https://claude.ai/code/session_019NMS1V2keS3pTbWRemCd9o