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.

Static manifest.json file is overridden with generated file

See original GitHub issue

Describe the bug

A manifest file added to the static folder i.e. /static/manifest.json is overwritten with a generated SvelteKit file at runtime (happens with adapter-node & adapter-auto).

Reproduction

Add /static/manifest.json file:

{
  "name": "test"
}

Build / run app, request /manifest.json, response is like:

{
  ".svelte-kit/runtime/client/start.js": {
    "file": "_app/immutable/start-1e83f480.js",
    "src": ".svelte-kit/runtime/client/start.js",
    "isEntry": true,
    "imports": [
      "_index-e11c2291.js",
      "_index-b191a7c7.js",
      "_singletons-eca981c1.js"
    ],
    "dynamicImports": [
      "src/routes/__layout.svelte",
      ".svelte-kit/runtime/components/error.svelte",
      "src/routes/folder/[...path]/__layout.svelte",
      "src/routes/about/index.svelte",
      "src/routes/cart/index.svelte",
      "src/routes/folder/[...path]/index.svelte",
      "src/routes/index.svelte",
      "src/routes/photo/[id].svelte"
    ]
  },
  ...

Logs

No response

System Info

System:
    OS: macOS 12.5
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 51.80 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - /usr/local/bin/node
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 102.1.39.111
    Chrome: 104.0.5112.79
    Chrome Canary: 106.0.5216.0
    Edge: 103.0.1264.77
    Firefox: 102.0.1
    Safari: 15.6
    Safari Technology Preview: 16.0
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.64 
    @sveltejs/adapter-node: next => 1.0.0-next.85 
    @sveltejs/kit: next => 1.0.0-next.401 
    svelte: ^3.49.0 => 3.49.0 
    vite: ^3.0.4 => 3.0.4

Severity

serious, but I can work around it

Additional Information

manifest.json is specifically mentioned as an example of using a static file:

assets — a place to put static files that should have stable URLs and undergo no processing, such as favicon.ico or manifest.json

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
PatrickGcommented, Aug 7, 2022

Is there any workaround for now?

You could simply name your manifest manifest.webmanifest.

That’s the official file extension for webmanifests anyway. https://developer.mozilla.org/de/docs/Web/Manifest

1reaction
benmccanncommented, Aug 4, 2022

manifest.json is a static file that Vite creates in the output directory and Vite copies the static assets to the output directory as well, so this seems like an issue that would need changes in Vite to address. Can you file an issue there? See https://github.com/sveltejs/kit#bug-reporting

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I reference a file in the manifest.json? - Reddit
The manifest.json file is a file that tells launchers what curseforge mods are in the pack as well as the specific versions of...
Read more >
How to override the "public" directory? - symfony
I've fixed my issue : In config/packages/webpack_encore.yaml : webpack_encore: # The path where Encore is building the assets.
Read more >
Chrome Extensions: Migrating to Manifest V3
A high-level guide to how you can migrate your Manifest V2 ... Updating the manifest.json file ... Static file injection with scripting.
Read more >
Descriptor (manifest.json) - SAP Help Portal
The manifest.json file defines static information about the application, such as the name of the application or the location of various files. It...
Read more >
Web app manifests - MDN Web Docs - Mozilla
Chrome Edge display Full support. Chrome39. Toggle history Full support. Edge7... display_override. Experimental Full support. Chrome89. Toggle history Full support. Edge8... icons Full support. Chrome39. Toggle...
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