Skip to content

Commit 337174d

Browse files
committed
Improve error message
1 parent 7ca8e2c commit 337174d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ module.exports = function (source) {
129129
const request = stringifyRequest(src + query)
130130
scriptImport = (
131131
`import script from ${request}\n` +
132-
`export * from ${request}` // support named exports
132+
`export * from ${request}\n` + // support named exports
133+
`if (!script) {\n` +
134+
` throw new Error('Component ${src} does not have a default export.')\n` +
135+
`}`
133136
)
134137
}
135138

0 commit comments

Comments
 (0)