histoire-dev / histoire-dev/histoire
Static assets linked by template don't get included in Histoire build (Vue)
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
The shortest reproduction is quite simple:
```html
![]()
```
Asset works fine in preview mode but doesn't get included in build, and the link points to `/src/assets/avatar.jpg`. There's a similar issue for Svelte version (#334), but i'm not quite sure, whether it is the same problem.
### Reproduction
https://stackblitz.com/edit/histoire-vue3-starter-ugha89?file=src/Reproduction.story.vue
### System Info
```shell
System:
OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
Memory: 23.01 GB / 31.27 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 16.20.0 - /usr/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 9.6.2 - ~/.npm-packages/bin/npm
Browsers:
Chrome: 113.0.5672.126
Firefox: 113.0.1
npmPackages:
@histoire/plugin-vue: ^0.16.1 => 0.16.1
@vitejs/plugin-vue: ^4.1.0 => 4.1.0
histoire: ^0.16.1 => 0.16.1
vite: ^4.2.1 => 4.2.1
```
### Used Package Manager
yarn
### 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
Research direction
Start with the Vue reproduction in src/Reproduction.story.vue from the linked StackBlitz project, then compare preview and build behavior for the relative image reference. Trace how the build handles the template asset and verify that the generated link no longer points to /src/assets/avatar.jpg and that the image is included in the build output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100