fiddle icon indicating copy to clipboard operation
fiddle copied to clipboard

Only absolute paths seem to work for assets

Open Ashtreighlia opened this issue 3 years ago • 2 comments

Hi, I've stumpled on a unexpected behaviour while trying to load some assets like a background image, fonts, ect. Relative paths won't load the requested files, while absolute paths work as expected.

File structure:

  • project-folder
    • standard fiddle-files
    • background-image.png
    • fonts
      • font 1
      • font 2

The following relative paths for the background image did not work: ./background-image.png ./project-folder/background-image.png

This absolute path worked for loading the background image: C:/.../project-folder/background-image.png

The same goes for the fonts. Is this a expected behaviour that can be circumvented or did I miss something?

Ashtreighlia avatar Sep 01 '22 10:09 Ashtreighlia

@Daginberth can you please provide a repro, perhaps as a gist?

codebytere avatar Sep 22 '22 12:09 codebytere

@codebytere an example can be found at https://gist.github.com/Daginberth/61e6fce8f962c398c6bbe503635a5d5e The only file changes regarding this issue are in the index.html. You just got to add an image ("test-image.jpg") to the same directory as the index.html

Ashtreighlia avatar Sep 22 '22 14:09 Ashtreighlia