Skip to content

Commit 2a5c9aa

Browse files
fix: fix read property error for accessing lang of script (#2060)
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>
1 parent 0ea614f commit 2a5c9aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ module.exports = function (source) {
117117
// let isTS = false
118118
const { script, scriptSetup } = descriptor
119119
if (script || scriptSetup) {
120-
const lang = script.lang || (scriptSetup && scriptSetup.lang)
120+
const lang = (script && script.lang) || (scriptSetup && scriptSetup.lang)
121121
// isTS = !!(lang && /tsx?/.test(lang))
122122
const externalQuery =
123123
script && !scriptSetup && script.src ? `&external` : ``

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy