histoire-dev / histoire-dev/histoire

histoire svelte doesn't include static files

Open
#334 10 comments 0 reactions 0 assignees View on GitHub
bug svelte3
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

files in image tags can be referrenced like the following in svelte
```

```

Histoire doesn't return that file. However, it does return a file at `/static/dir/file.png`

### Reproduction

create an image tag with a `src="/dir/file.png"` image the static folder, create a histoire story, import the svelte component with the image tag. The image does not load. now prepend the src path with `static/` and the image wil load in Histoire

### System Info

```shell
mac, chrome
```

### Used Package Manager

npm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Research direction

Start with the provided Svelte reproduction using an image at /dir/file.png and compare it with /static/dir/file.png in Histoire. Check how the static folder is served and verify that the unprefixed path loads without changing the component; done means both paths resolve as expected in the story.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.