Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Chrome reports a syntax error at line 1, column 1 for manifest.json

ErrorManifest: Line: 1, column: 1, Syntax error.

Short answer

Chrome reads the manifest as JSON. A syntax error at line 1, column 1 almost always means the URL returned something else, usually your index.html, because the file is missing, the path is wrong or a catch-all route answers first. Fetch the manifest URL with curl and fix whatever serves it.

  • Applies to Chrome, Vite, Netlify, React 19
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Request the exact manifest URL from the link tag and look at what comes back. If the body starts with <!doctype html>, the browser is parsing a web page as JSON.

    curl -s -D - https://example.com/manifest.json | head -15
  2. 2Match what you see, then jump to its fix

    1. 1The curl response is your index.html, or only breaks on nested routesThe path in the link tag does not point at the fileFix
    2. 2The status is 200 but the body is HTMLA catch-all rewrite answers for the missing fileFix
    3. 3The response is your login page, or 401/403, when you request it without cookiesThe manifest is behind a login and the request sends no credentialsFix

What does the error look like?

  • Manifest: Line: 1, column: 1, Syntax error.

Cause 1 of 3

The path in the link tag does not point at the file

1Check

A relative href such as manifest.json resolves against the current URL, so it points at a different place on /app/orders than on /. With Vite, a file that is not in public/ is not served at the site root.

grep -n "rel=\"manifest\"" index.html
ls public/manifest.json

2Fix

Put the file in public/ and link it with a root-absolute path.

<link rel="manifest" href="/manifest.json" />

3Verify

Request the URL again; the body is JSON.

curl -s https://example.com/manifest.json | head -5

Confirmed by vite.dev

Did this fix it?

Cause 2 of 3

A catch-all rewrite answers for the missing file

1Check

A single-page-app rule that sends every path to index.html also answers for a manifest path that has no file. A rewrite does not override a URL that matches a real file, so adding the file to the publish folder fixes this.

curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://example.com/manifest.json

2Fix

Make sure the manifest is part of the deployed output, in the folder Netlify publishes.

npm run build
ls dist/manifest.json

3Verify

After deploy, the content type is JSON rather than text/html.

curl -s -o /dev/null -w "%{http_code} %{content_type}\n" https://example.com/manifest.json

Confirmed by docs.netlify.com

Did this fix it?

Cause 3 of 3

The manifest is behind a login and the request sends no credentials

1Check

A manifest request is made without credentials unless the link tag says otherwise. If the server wants a cookie, it answers with a login page.

curl -s -o /dev/null -w "%{http_code}\n" https://example.com/manifest.json

2Fix

Serve the manifest without authentication, or add crossorigin="use-credentials" to the link tag when it must be protected.

<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />

3Verify

Reload the page with DevTools open; the manifest error is gone.

// DevTools > Application > Manifest

Confirmed by developer.mozilla.org

Did this fix it?

How do I stop it coming back?

  • Use root-absolute paths for the manifest and its icons.
  • Add a build step that checks dist/manifest.json exists and parses as JSON.
  • Serve the file as application/manifest+json when you use the .webmanifest extension.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

A React app on Netlify shows 404 when you reload a route

Opening /about from a link works; pressing refresh or pasting the URL gives 404

Netlify looks for a real file at the URL you reload, finds none for a client-side route like /dashboard, and returns 404.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.