Skip to content

Commit

Permalink
fix(build): Cannot read properties of undefined (reading 'isCollecting')
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 5, 2023
1 parent 0075dfa commit 2208e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/histoire-plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function HstVue (): Plugin {
enforce: 'post',
transform (code, id) {
// Remove vue warnings about unknown components
if (this.meta.histoire.isCollecting && id.endsWith('.vue')) {
if (this.meta.histoire?.isCollecting && id.endsWith('.vue')) {
return `const _stubComponent = (name) => ['Story','Variant'].includes(name) ? _resolveComponent(name) : ({ render: () => null });${code.replaceAll('_resolveComponent(', '_stubComponent(')}`
}
},
Expand Down

0 comments on commit 2208e31

Please sign in to comment.