Skip to content

Commit 31bbae3

Browse files
committed
fix: compile error
1 parent 639a742 commit 31bbae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/core/transform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function transformVueJsxVapor(
158158
if (options?.compile && isJSXExpression(node)) {
159159
let { code, preamble } = options.compile(content, { mode: 'module', inline: true })
160160
preamble.match(/(\w+ as \w+)/g)?.forEach(s => importSet.add(s))
161-
runtime = preamble.match(/(["'].*["'])/)![1]
161+
runtime = preamble.match(/(["'].*["'])/)?.[1] || '"vue"'
162162
if (content.includes('<slot ')) {
163163
code = code.replace('_ctx', '_ctx = _getCurrentInstance().ctx')
164164
importSet.add('getCurrentInstance as _getCurrentInstance')

0 commit comments

Comments
 (0)