Skip to content

[BUG] plugin:vite:json — Failed to parse JSON (Invalid JSON syntax: missing comma) #666

@rohithgowda18

Description

@rohithgowda18

Explaining the Issue...

Summary

The dev-server error was caused by invalid JSON in two data files: javascript.json and html.json.
Both errors were due to a missing comma after the "tag": "js" / "tag": "html" properties for the Programiz entries, which made the JSON unparsable and triggered Vite's JSON plugin overlay.

What I changed

Fixed syntax by adding the missing commas in:

  • javascript.json
  • html.json

Why it broke

JSON must be strictly valid. A missing comma between object properties makes the whole file invalid.
Vite tries to parse .json imports at build/dev time; when parsing fails it throws the overlay error you saw:

Example error: [plugin:vite:json] Failed to parse JSON file, invalid JSON syntax found at line ...

That prevented the dev server from finishing its transform step.


Solution

  1. Add the missing comma after each "tag" property in the affected entries of both files (javascript.json and html.json).
  2. Save the files. Restart Vite dev-server if needed.
  3. Verify the JSON is valid (you can use online JSON validators) and confirm Vite overlay errors no longer occur.

After this fix, the dev-server should start and the overlays for JSON syntax errors will be gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions