Nextjs error with manifest.json: Manifest: Line: 1, column: 1, Syntax error.
See original GitHub issueBug 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.json
I 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
intopublic
folder – the URL will be just<link rel="manifest" href="/manifest.json" />
. This location is preferred overstatic
since Next.js 9.1, whenpublic
folder support was introduced.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.