diff --git a/lib/index.js b/lib/index.js index ea1f0177f..a65a73abf 100644 --- a/lib/index.js +++ b/lib/index.js @@ -117,7 +117,7 @@ module.exports = function (source) { // let isTS = false const { script, scriptSetup } = descriptor if (script || scriptSetup) { - const lang = script.lang || (scriptSetup && scriptSetup.lang) + const lang = (script && script.lang) || (scriptSetup && scriptSetup.lang) // isTS = !!(lang && /tsx?/.test(lang)) const externalQuery = script && !scriptSetup && script.src ? `&external` : ``