Comments (2)
Start a new pull request in StackBlitz Codeflow.
from histoire.
We also experienced this bug. It only breaks the SourceCodePreview and it only happens, when no attributes or props are set on a the component of the story:
<Story>
<MyComponent></MyComponent>
</Story>
Even setting an aria-label="test"
makes it work again.
The issue lies here:
histoire/packages/histoire-plugin-vue/src/client/codegen.ts
Lines 123 to 124 in 692e6f5
Because @ts-ignore
is set and the project doesn't use TypeScript strict
mode, the access to vnode.props
is not marked as unsafe, as it can be null
!
Just checking if vnode.props
is truthy is enough to fix the bug:
- // @ts-ignore
- const vmodelListener = vmodelListeners.find(key => vnode.dynamicProps?.includes(key) || key in vnode.props)
+ const vmodelListener = vmodelListeners.find(key => vnode.dynamicProps?.includes(key) || (vnode.props && key in vnode.props))
Sadly the source code in the npm package is minified, but we still managed to patch it with pnpm
:
diff --git a/dist/bundled/client/codegen.js b/dist/bundled/client/codegen.js
index 6b922b51e716d6e5df1d0efd8358cbbf36f656c5..13ccbaa62998ae2b7e7934b6303a20dd74223249 100644
--- a/dist/bundled/client/codegen.js
+++ b/dist/bundled/client/codegen.js
@@ -38,7 +38,7 @@ async function k(e, o = null) {
t.startsWith("on") && (f = "@");
const L = f === "@" ? `${t[2].toLowerCase()}${t.slice(3)}` : t, M = [`onUpdate:${t}`, `onUpdate:${N(t)}`].find((p) => {
var $;
- return (($ = e.dynamicProps) == null ? void 0 : $.includes(p)) || p in e.props;
+ return (($ = e.dynamicProps) == null ? void 0 : $.includes(p)) || (e.props && p in e.props);
});
if (f === ":" && M) {
j.push(M);
from histoire.
Related Issues (20)
- make nuxt module that allows it to run and build along side the main project
- Error [ERR_UNSUPPORTED_DIR_IMPORT] when trying to use `@heroicons/vue` with `histoire` HOT 6
- Bad character escape sequence, expected 4 hex characters
- Logo is not displaying HOT 1
- Nuxt3 + Vuetify nuxt module : Could not find defaults instance HOT 1
- Nuxt UI <ULink> generates an error HOT 1
- Bug with i18n and translation in component HOT 7
- Changes in `0.17.15` and `responsiveDisabled=true` lead to unexpected behavior HOT 1
- Vuetify button cannot be mounted on story with grid layout HOT 1
- directory import is not supported resolving ES modules imported from csv-parse HOT 1
- Support twoslash
- Nuxt3 Public assets bug HOT 2
- 404 on sponsor page
- Nuxt3 nuxt-modules/icon custom icons not showing HOT 2
- Nuxt3 public assets in layers HOT 5
- Support Vite 4.0+
- Histoire Tailwind css should be in a layer HOT 2
- How to access window variables
- Error: Cannot find module HOT 1
- ReferenceError: indexedDB is not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from histoire.