histoire-dev / histoire-dev/histoire

Cannot read properties of null (reading 'getLiteralValueAtPath')

Open
#424 8 comments 4 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

After updating my current project to Histoire v.0.12.4, Vite 4.0.4, and Vue to v.3.2.45 when running the build I start getting this error
```
Cannot read properties of null (reading 'getLiteralValueAtPath')
TypeError: Cannot read properties of null (reading 'getLiteralValueAtPath')
at Identifier.getLiteralValueAtPath (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:7932:47)
at ChainExpression.getObjectValue (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:9533:39)
at ChainExpression.hasEffects (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:9524:18)
at UnaryExpression.hasEffects (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:12076:31)
at BinaryExpression.hasEffects (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:5701:28)
at BinaryExpression.hasEffects (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:8904:22)
at IfStatement.hasEffects (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:10356:23)
at IfStatement.shouldBeIncluded (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:5789:62)
at BlockStatement.include (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:8295:56)
at FunctionDeclaration.include (file://file:///home/projects/histoire-vue3-starter-3pexya/node_modules/rollup/dist/es/shared/rollup.js:8410:19) {
watchFiles: [
'/home/projects/histoire-vue3-starter-3pexya/node_modules/@histoire/app/dist/bundle-main.js',
...
... 161 more items
]
}
```

Together with this I also get a few warnings
```
vite v4.0.4 building for development...
transforming (246) ../../../__resolved__virtual:$hiUse of eval in "node_modules/flexsearch/dist/flexsearch.bundle.js" is strongly discouraged as it poses security risks and may cause issues with minification.
"setupVanilla" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/histoire/dist/node/builtin-plugins/vanilla-support/RenderStory.js".
"setupVanilla" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/histoire/dist/node/builtin-plugins/vanilla-support/RenderStory.js".
"setupVanilla" is not exported by "histoire.setup.ts", imported by "node_modules/histoire/dist/node/builtin-plugins/vanilla-support/RenderStory.js".
"setupVanilla" is not exported by "histoire.setup.ts", imported by "node_modules/histoire/dist/node/builtin-plugins/vanilla-support/RenderStory.js".
"setupVue3" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/@histoire/plugin-vue/dist/bundled/client/app/MountStory.js".
"setupVue3" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/@histoire/plugin-vue/dist/bundled/client/app/MountStory.js".
"setupVue3" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/@histoire/plugin-vue/dist/bundled/client/app/RenderStory.js".
"setupVue3" is not exported by "../../../__resolved__virtual:$histoire-generated-global-setup", imported by "node_modules/@histoire/plugin-vue/dist/bundled/client/app/RenderStory.js".
```

### Reproduction

Available here:
https://stackblitz.com/edit/histoire-vue3-starter-3pexya?file=package.json

### System Info

```shell
System:
OS: macOS 13.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 126.89 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Browsers:
Brave Browser: 108.1.46.144
Chrome: 108.0.5359.124
Firefox: 108.0.1
Safari: 16.1
npmPackages:
@histoire/plugin-vue: ^0.12.4 => 0.12.4
@vitejs/plugin-vue: ^4.0.0 => 4.0.0
histoire: ^0.12.4 => 0.12.4
vite: ^4.0.4 => 4.0.4
```

### 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 by running the build in the linked StackBlitz reproduction with the listed Histoire, Vite, Vue, and Node versions. Read package.json and the reported Rollup stack trace, then trace the generated setup imports and build inputs shown in the warnings. Done means the reproduction builds without the reported null-property failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rollup, typescript, vite
Domain
build-system, devtools, 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.