question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nextjs error with manifest.json: Manifest: Line: 1, column: 1, Syntax error.

See original GitHub issue

Bug report

Describe the bug

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

When I open the route to our manifest http://localhost:3000/static/manifest.jsonI just get our standard error page html response.

My manifest.json file:

{
  "name": "Foo",
  "short_name": "foo",
  "start_url": "/",
  "background_color": "#ffffff",
  "theme_color": "#00427b",
  "display": "minimal-ui",
  "orientation": "portrait-primary",
  "icons": [
    { "src": "/static/images/logo/icon-48x48.png", "sizes": "48x48", "type": "image/png" },
    { "src": "/static/images/logo/icon-72x72.png", "sizes": "72x72", "type": "image/png" },
    { "src": "/static/images/logo/icon-96x96.png", "sizes": "96x96", "type": "image/png" },
    { "src": "/static/images/logo/icon-144x144.png", "sizes": "144x144", "type": "image/png" },
    { "src": "/static/images/logo/icon-192x192.png", "sizes": "192x192", "type": "image/png" },
    { "src": "/static/images/logo/icon-256x256.png", "sizes": "256x256", "type": "image/png" },
    { "src": "/static/images/logo/icon-384x384.png", "sizes": "384x384", "type": "image/png" },
    { "src": "/static/images/logo/icon-512x512.png", "sizes": "512x512", "type": "image/png" }
  ]
}

This is how manifest is reference inside <Head>:

      <Html>
        <Head>
          <Favicon />
          <link rel="manifest" href="/static/manifest.json" />
        </Head>

I have tried answers provided in google:

# remove .next dir
rm -rf .next 

# remove node module and then yarn install again
rm -rf node_modules 

# remove yarn lock
rm yarn.lock 

I’m using current latest version of nextjs: 9.1.4

But nothing seems to work

Expected behavior

I expect manifest.json to actually work

System information

  • OS: macOS
  • Browser: All of them
  • Version of Next.js: 9.1.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kachkaevcommented, Dec 4, 2019

This could be just browser cache for /static/manifest.json, which returned an HTML error the first time you hit that URL (e.g. because at some point your file was linked from your page, but did not exist).

You can put manifest.json into public folder – the URL will be just <link rel="manifest" href="/manifest.json" />. This location is preferred over static since Next.js 9.1, when public folder support was introduced.

0reactions
balazsorban44commented, Jan 27, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next.js PWA Error: Manifest: Line: 1, column: 1, Syntax error
Whenever I start the app the service worker is registered but it can't find the manifest.json . Here is my next.config.js file, it...
Read more >
Line: 1, column: 1, Syntax error on Chrome browser-Reactjs
This error message seems to be a catchall error for a lot of issues. For me the issue was using http-server to load...
Read more >
Manifest: Line 1, column: 1, Syntax error. in React || Solved
Manifest : Line 1, column : 1, Syntax error in react solved .Subscribe this channel to get solution for the programmingError ...
Read more >
React.js: Manifest: Line: 1, column: 1, Syntax error - Reddit
This is my manifest.json in public folder { "short_name": "React App", "name": "Create React App Sample", "icons": [ { "src": "favicon.ico", ...
Read more >
Next.Js Pwa Error: Manifest: Line: 1, Column: 1 ... - ADocLib
Manifest: Line: 1 column: 1 Syntax error. Solution: If your manifest file is at root level where your index.html is you can reference...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found