eleventy icon indicating copy to clipboard operation
eleventy copied to clipboard

eleventy --serve adding trailing slash to manifest.json

Open heath3 opened this issue 3 years ago • 1 comments

Describe the bug When running eleventy --serve for local development if I try to access my manifest.json I get a 301 redirect to /manifest.json/ (i.e. including a trailing slash) which then errors.

To Reproduce Steps to reproduce the behavior:

  1. Run npx @11ty/eleventy --serve
  2. Go to https:localhost'8080/manifest.json
  3. See error

Expected behavior The manifest.jsonshould be served

  • OS and Version: Mac OS 11
  • Eleventy Version: 1.0.1

heath3 avatar Jul 02 '22 08:07 heath3

@heath3 I'm unable to reproduce that locally on macOS 12.4 w/ [email protected]: https://github.com/pdehaan/11ty-2484

npm run serve

> [email protected] serve
> eleventy --serve

[11ty] Writing www/index.html from ./src/index.njk
[11ty] Writing www/manifest.json from ./src/manifest.njk
[11ty] Wrote 2 files in 0.04 seconds (v1.0.1)
[11ty] Watching…
[Browsersync] Access URLs:
 -------------------------------
    Local: http://localhost:8081
 External: http://false:8081
 -------------------------------
[Browsersync] Serving files from: www

And if I navigate to http://localhost:8081/manifest.json locally, it seems to show me my fake manifest JSON file:

{
  "generator": "Eleventy v1.0.1"
}

pdehaan avatar Jul 02 '22 14:07 pdehaan

Hi @heath3,

did you set a permalink in your manifest.json or have it set as a passthrough copy? By default it might be interpreted as a template or not even picked up correctly.

What files do you see in your output folder and does it work correctly when running in "normal" build mode?

Snapstromegon avatar Aug 30 '22 13:08 Snapstromegon

It's just a .json file which is copied over via addPassthroughCopy. I hadn't checked in on it in a while and I may well have made changes in the meantime but it appears to be working just fine now in --serve mode so I'll close. Thanks.

heath3 avatar Aug 30 '22 14:08 heath3