fix(prerender): handle JSON imports during prerender bundling#1580
fix(prerender): handle JSON imports during prerender bundling#1580Tobbe merged 3 commits intocedarjs:mainfrom
Conversation
Rollup's prerender build didn't have a JSON transform plugin, so any page that transitively imported a .json file (e.g. .cedar/gqlorm-schema.json) would fail with "Expected ';', '}' or <eof>". Add a simple inline transform plugin that wraps JSON file contents as a default export. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cedarjs canceled.
|
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 2s | View ↗ |
nx run-many -t build |
✅ Succeeded | 8s | View ↗ |
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
✅ Succeeded | 1m 28s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 10s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-04-11 18:42:31 UTC
Greptile SummaryThis PR fixes prerender bundling failures caused by Confidence Score: 5/5Safe to merge — targeted fix with no regressions, correct JSON normalization via JSON.parse/JSON.stringify. No P0 or P1 issues found. The implementation correctly normalizes JSON content (addressing the prior thread concern about raw byte pass-through). The inline plugin avoids a new dependency, plugin ordering is correct, and the fix is scoped entirely to the prerender bundling path. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into lisa/fix-preren..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
The changes in this PR are now available on npm. Try them out by running Or try it in a new app with |
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

Summary
.jsonfile (e.g..cedar/gqlorm-schema.json) would fail withRollupError: Expected ';', '}' or <eof>transformplugin that wraps.jsonfile contents as a default export, matching the core behavior of@rollup/plugin-jsonReproduction
Test plan
yarn cedar prerender --dry-runon a project that imports.cedar/gqlorm-schema.json(directly or transitively) — should no longer throw🤖 Generated with Claude Code