histoire-dev / histoire-dev/histoire

[Nuxt] useState crashes histoire - nuxt is undefined

Open
#197 14 comments 2 reactions 0 assignees View on GitHub
bug nuxt
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When using useState, histoire crashes

![image](https://user-images.githubusercontent.com/2798204/182483971-48b019f2-e091-4aab-befb-e0b816b33085.png)

### Reproduction

https://stackblitz.com/edit/nuxt-starter-szzksv?file=package.json,components%2FHello.vue,components%2FHello.story.vue

### System Info

```shell
Stackblitz
```

### 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 linked StackBlitz reproduction, especially package.json, components/Hello.vue, and components/Hello.story.vue, and reproduce the crash when using useState. Trace why histoire reports that nuxt is undefined; done when the Nuxt story runs without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.