histoire-dev / histoire-dev/histoire

`viteNodeInlineDeps` replaces existing values

Open
#762 1 comment 2 reactions 0 assignees View on GitHub
to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

If the `viteNodeInlineDeps` option is set to anything, it completely replaces any value set by other sources, i.e. plugins. Most notably, this completely breaks Nuxt functionality, as all deps set by the Histoire Nuxt plugin are removed.

The reason this happens is due to the change introduced in [this commit](https://github.com/histoire-dev/histoire/commit/95c29dd3772ac529455f6c820331600cb2b6be00), but as I don't know the reasoning behind this change, it's difficult to say what else could be impacted by reverting it.

### Reproduction

Add the following to the config in the default Nuxt StackBlitz berfore starting the dev server:
```
viteNodeInlineDeps: [],
```

### System Info

```shell
System:
OS: macOS 14.6.1
CPU: (14) arm64 Apple M3 Max
Memory: 99.98 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.11.1/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 8.15.4 - ~/Library/pnpm/pnpm
bun: 1.1.25 - ~/.bun/bin/bun
Browsers:
Chrome: 128.0.6613.138
Safari: 17.6
npmPackages:
@histoire/plugin-nuxt: ^0.17.17 => 0.17.17
@histoire/plugin-vue: ^0.17.17 => 0.17.17
histoire: ^0.17.17 => 0.17.17
nuxt: ^3.13.0 => 3.13.0
```

### 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

Open the contributing guide

Research direction

Start by reviewing commit 95c29dd3772ac529455f6c820331600cb2b6be00 and reproduce the issue in the default Nuxt StackBlitz with viteNodeInlineDeps set to []. Trace how that option combines with values supplied by plugins. Done means existing plugin-provided dependencies remain intact while the explicit option still behaves as intended, and the Nuxt dev server starts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript, vite
Domain
build-system, tooling
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.