Skip to content

fix(dashboard): make RequestLoggerDetail loadable outside Next — CSS via globals.css + CJS/ESM interop (#11703 base-reds) - #12114

Merged
diegosouzapw merged 2 commits into
release/v3.8.51from
fix/release-v3.8.51-basereds-round2
Aug 30, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.51from
fix/release-v3.8.51-basereds-round2

Conversation

@diegosouzapw

@diegosouzapw diegosouzapw commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Origin

#11703 (5684589ce7, collapsible JSON tree viewer) imports react18-json-view/src/{style,dark}.css at module level in RequestLoggerDetail(.sections).tsx and uses a bare default import of react18-json-view. Next handles both; nothing else does — so on the release/v3.8.51 tip every test that renders the component dies, which is why all 4 unit shards are red on every open PR (e.g. #12106, #12099, #12081):

symptom cause
request-log-detail-{layout,stream}, request-logger-detail-copy-all, request-timeline-lane-allocation — ERR_UNKNOWN_FILE_EXTENSION ".css" CSS import in a module loaded by node:test/tsx
media-page-client-browser-bundle — esbuild cannot resolve the .css specifiers same
Element type is invalid … got: object once the CSS is out of the way node ESM resolves the package's CJS main (no exports map) → default import is the module namespace
i18n-vi-completeness ×3 5 new requestLogger.detail.* keys without vi (strict parity)

Fix (at the source, not in the tests)

  • src/app/globals.css: @import the two stylesheets there (same pattern as material-symbols/fumadocs); the components no longer import CSS.
  • Components: const JsonView = (mod.default ?? mod) — the interop already used by redisQuotaStore/keytar-reader.
  • vi.json: the 5 strings.

Validation

  • node:test: the 6 affected files → 24/24 pass; vitest payload-section-collapsible-json + timestamp-titles → 8/8.
  • eslint + prettier clean on the touched files.
  • Local node_modules needed react18-json-view installed (npm install --no-save) — CI's npm ci already has it (the lockfile is fine).

⚠️ base-red inherited: every red check here reproduces on the pure release/v3.8.51 tip (see the merge-batch audit in the session report) and none touches this PR's files.

…via globals.css, CJS/ESM interop for react18-json-view

Origin: #11703 (5684589) imported `react18-json-view/src/{style,dark}.css` at
module level in RequestLoggerDetail(.sections).tsx and relied on the bundler's
default-import interop. Next is fine with both, but every test that renders the
component died on the release tip:

- node:test / tsx: ERR_UNKNOWN_FILE_EXTENSION ".css" — request-log-detail-layout,
  request-log-detail-stream, request-logger-detail-copy-all,
  request-timeline-lane-allocation (4 unit shards red on every PR).
- esbuild bundle-safety check (media-page-client-browser-bundle): cannot resolve the
  .css specifiers.
- node ESM resolves the package's CJS `main` (no `exports` map), so the default
  import is the module namespace: "Element type is invalid … got: object".

Fix at the source: the two stylesheets are @imported from src/app/globals.css
(same as material-symbols / fumadocs), and the component unwraps `mod.default ??
mod` like redisQuotaStore/keytar already do. Also adds the 5 vi strings #11703
introduced (requestLogger.detail.{collapseAllLevels,collapseOneLevel,
currentExpandLevel,expandOneLevel,expandAllLevels}) — vi has strict parity.

Refs #11703
…omponents/jsonView.ts

RequestLoggerDetail.tsx is frozen by check:file-size (1111 lines, cannot grow); the
inline interop pushed it to 1118. One tiny module serves both components and keeps
the CSS-import warning in a single place.
@diegosouzapw
diegosouzapw merged commit 485c2dc into release/v3.8.51 Aug 30, 2026
14 of 21 checks passed
@diegosouzapw
diegosouzapw deleted the fix/release-v3.8.51-basereds-round2 branch August 30, 2026 12:46
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…via globals.css + CJS/ESM interop (diegosouzapw#11703 base-reds) (diegosouzapw#12114)

* fix(dashboard): make RequestLoggerDetail loadable outside Next — CSS via globals.css, CJS/ESM interop for react18-json-view

Origin: diegosouzapw#11703 (a4fd3d0) imported `react18-json-view/src/{style,dark}.css` at
module level in RequestLoggerDetail(.sections).tsx and relied on the bundler's
default-import interop. Next is fine with both, but every test that renders the
component died on the release tip:

- node:test / tsx: ERR_UNKNOWN_FILE_EXTENSION ".css" — request-log-detail-layout,
  request-log-detail-stream, request-logger-detail-copy-all,
  request-timeline-lane-allocation (4 unit shards red on every PR).
- esbuild bundle-safety check (media-page-client-browser-bundle): cannot resolve the
  .css specifiers.
- node ESM resolves the package's CJS `main` (no `exports` map), so the default
  import is the module namespace: "Element type is invalid … got: object".

Fix at the source: the two stylesheets are @imported from src/app/globals.css
(same as material-symbols / fumadocs), and the component unwraps `mod.default ??
mod` like redisQuotaStore/keytar already do. Also adds the 5 vi strings diegosouzapw#11703
introduced (requestLogger.detail.{collapseAllLevels,collapseOneLevel,
currentExpandLevel,expandOneLevel,expandAllLevels}) — vi has strict parity.

Refs diegosouzapw#11703

* refactor(dashboard): move the react18-json-view interop into shared/components/jsonView.ts

RequestLoggerDetail.tsx is frozen by check:file-size (1111 lines, cannot grow); the
inline interop pushed it to 1118. One tiny module serves both components and keeps
the CSS-import warning in a single place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant