fresh icon indicating copy to clipboard operation
fresh copied to clipboard

[Fresh-v2] Building assets with subfolders fails on windows

Open csvn opened this issue 1 year ago • 0 comments

When building Fresh v2 on Windows, using subfolders for assets seems to break when running the app in production after building. The reason seems to be inconsistent paths with \\:

  "staticFiles": {
    "/images\\logo.svg": {
      "hash": "1e0b7aa79648883158742ec4f064980898c4c8feff0c3300b8c7ea4485ef1354",
      "generated": false
    },

Trying to fetch /images/logo.svg just gives a HTTP 404 error.

Reproduction

  1. Initialize a Fresh project
    deno run -Ar jsr:@fresh/[email protected]
    
  2. Move the assets/logo.svg to assets/images/svg.logo
  3. Update routes/index.tsx with updated image path
  4. Build Fresh with deno task build
  5. Start prod server with deno task start
  6. Link to image is broken

csvn avatar Oct 11 '24 10:10 csvn