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.

`manifest.json` file collision

See original GitHub issue

Describe the bug

If you set build.manifest: true and have a file named manifest.json in the publicDir then the manifest.json file will be overwritten.

As a framework, we can set the name of build.manifest to something else, but it’s impossible to know in advance all the possible file names our users may have.

Originally reported in https://github.com/sveltejs/kit/issues/5803

Reproduction

git clone git@github.com:sveltejs/kit.git
cd kit/sites/kit.svelte.dev
git reset --hard 0801e8e942534d3f6c614523f0ee4fe10b602b26
pnpm install
pnpm run dev

Visit http://localhost:5173/manifest.json in the browser and see the Vite manifest rather than the file in static/manifest.json

System Info

Vite 3.0.5

Used Package Manager

pnpm

Logs

No response

Validations

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
ElMassimocommented, Aug 19, 2022

Making that exception when it contains a slash might make it harder for tooling to infer the correct location.


I prefer the simpler proposal of using ${outDir}/.vite/manifest.json, which would make it easier for the ecosystem to upgrade:

  • Look for ${outDir}/.vite/manifest.json:
    • If the file exists (vite@4), use it
    • If it doesn’t exist (vite@3), look for the manifest in the old location, ${outDir}/manifest.json
2reactions
patak-devcommented, Aug 19, 2022

I was thinking of only one top-level hidden folder for Vite artifacts:

dist/.vite/manifest.json
dist/.vite/ssr-manifest.json

And maybe others in the future. This is independent of the way users do their dist setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

manifest.json - Mozilla - MDN Web Docs
Chrome Edge action Full support. Chrome88. footnote. Toggle history Full support. Edge88... action.browser_style Full support. Chrome88. Toggle history Full support. Edge88... action.default_area Full support. Chrome88. Toggle...
Read more >
How can I use php to populate a manifest.json file?
I've tried switching the name of my manifest to manifest.php and used header('Content-Type: application/json') within it. Inside my index file ...
Read more >
The Manifest - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
SMAPI can't see manifest.json even though it is clearly there.
I'm having a problem where SMAPI can't load mods in a folder "because it contains files, but none of them are manifest.json.
Read more >
Locating your inventory list - Amazon Simple Storage Service
It is added to prevent collisions when multiple inventory reports from different ... Example Inventory manifest in a manifest.json file.
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