Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7be1a2b

Browse files
committed
fix(type): type error on built package
1 parent 842bcd6 commit 7be1a2b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/runtime/components/ContentRenderer.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ function resolveVueComponent(component: string | Renderable) {
134134
}
135135
else if (localComponents.includes(pascalCase(component))) {
136136
_component = defineAsyncComponent(() => {
137-
// @ts-expect-error - typescript doesn't know about the import
138-
return import('#content/components').then(m => m[pascalCase(component)]())
137+
return import('#content/components')
138+
.then((m) => {
139+
const comp = m[pascalCase(component)] as unknown as () => unknown
140+
return comp ? comp() : undefined
141+
})
139142
})
140143
}
141144
if (typeof _component === 'string') {

0 commit comments

Comments
 (0)