histoire-dev / histoire-dev/histoire
Sourcemap not generated with "histoire-file-name-plugin"
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
The bitbucket pipeline (CI/CD) breaks during the execution of the`histoire build` process. The error message received during the build process is as follows:
> Sourcemap is likely to be incorrect: a plugin (histoire-file-name-plugin) was used to transform files but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
This message repeats until `Container 'Build' exceeded memory limit` and the `terminal` being killed.

### Reproduction
1. Set up the project with the required dependencies and configuration.
> add an additional plugin in `vite.config.ts` file
```js
process.env.SENTRY_AUTH_TOKEN &&
sentryVitePlugin({
org: 'org',
project: 'project',
sourcemaps: {
assets: './dist',
},
// Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
```
> `histoire.config.ts` file
```js
import { HstVue } from '@histoire/plugin-vue';
import { defineConfig } from 'histoire';
export default defineConfig({
plugins: [HstVue()],
setupFile: 'histoire.setup.ts',
});
```
3. Execute the `histoire build` command to trigger the build process.
4. Observe the error message regarding the sourcemap generation for the `histoire-file-name-plugin`.
### Package versions:
```shell
1.@sentry/vite-plugin: "^2.2.2"
2.vite: "^4.3.9"
3.vue: "^3.3.4"
4.histoire: "^0.16.1"
```
### 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
Research direction
Start by reproducing the failure with the shown vite.config.ts and histoire.config.ts, then run the histoire build command and inspect how histoire-file-name-plugin handles transformed files. Done means the build no longer repeats the sourcemap warning or exceeds the Bitbucket memory limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100