Skip to content

fix(projects): strip UTF-8 BOM from 3 project.json manifests (NPE on /projects/<slug>) - #126

Open
arcgod-design wants to merge 1 commit into
MistryVishwa:mainfrom
arcgod-design:fix/buildverse-project-bom
Open

fix(projects): strip UTF-8 BOM from 3 project.json manifests (NPE on /projects/<slug>)#126
arcgod-design wants to merge 1 commit into
MistryVishwa:mainfrom
arcgod-design:fix/buildverse-project-bom

Conversation

@arcgod-design

Copy link
Copy Markdown
Contributor

What

Strips the UTF-8 BOM (EF BB BF) prefix from three project.json manifests that currently ship on main:

Why

BuildVerse's src/app/api/projects/route.js wraps JSON.parse(fileContents) in try/catch and silently drops any project whose manifest fails to parse:

try {
  const meta = JSON.parse(fileContents);
  // …register project…
} catch (err) {
  continue; // skipped, no error surfaced
}

A UTF-8 BOM at byte 0 makes JSON.parse throw SyntaxError: Unexpected token \uFEFF in JSON. The three projects thus disappear from /projects AND 404 on their own /projects/<slug> routes once merged.

I verified this against upstream/main at 52cf847 directly after the merges landed:

$ git show upstream/main:projects/fake-product-detector/project.json | head -c 8 | xxd
00000000: efbb bf7b 2274 6974                        ...{"tit
                       ^^^^^ BOM

The same BOM appears at the start of all three files.

Fix

Strip the 3-byte BOM prefix. No other change to name / description / tags / author, and no change to the HTML or README in any of the three project folders.

- binary diff: -3 bytes at offset 0
+ {"title":"Fake Product Detector",…}   (parses cleanly)

Verification

Locally (PowerShell):

PS> $b = [IO.File]::ReadAllBytes("projects/fake-product-detector/project.json")
PS> $b[0..2]   # → 123 34 116 = {"t   (no BOM)
PS> $j = ([Text.Encoding]::UTF8.GetString($b) | ConvertFrom-Json)
PS> $j.title   # → "Fake Product Detector"

Same for medical-appointment-system (parses, title = "Medical Appointment System") and ai-code-review (parses, title = "AI Code Review Assistant").

Scope

Single one-line-per-file fix. No new features, no API change, no UI change.

Context

Closes #96 (BOM follow-up).
Relates to #108, #111, #116.

Three project.json manifests shipped with a UTF-8 BOM (EF BB BF) prefix
that breaks BuildVerse's project loader:

  - projects/fake-product-detector/project.json    (added in MistryVishwa#108 @ fc8b9d5)
  - projects/medical-appointment-system/project.json (added in MistryVishwa#111 @ 168e864)
  - projects/ai-code-review/project.json           (added in MistryVishwa#116 @ c40fe7b)

BuildVerse's src/app/api/projects/route.js wraps JSON.parse in try/catch
and silently drops any project whose manifest fails to parse. A BOM at
byte 0 throws SyntaxError: Unexpected token \uFEFF in JSON, so all
three projects disappear from the /projects directory AND 404 on their
own /projects/<slug> routes once merged.

Stripping the 3-byte BOM prefix lets JSON.parse succeed. No other
change to name/description/author/tags or to the project HTML/README.
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

@arcgod-design is attempting to deploy a commit to the vishwamistrylearning-1037's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

{project] Fake Product Detection

1 participant