File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,13 @@ import { useStyleTag } from "@vueuse/core";
17
17
import hash from "hash-sum" ;
18
18
import { transform } from "sucrase" ;
19
19
20
- const fetchText = async ( url : string ) => {
20
+ const body = "<template></template>" ,
21
+ fetchText = async ( url : string ) => {
21
22
try {
22
23
const response = await fetch ( url ) ;
23
- return response . ok ? response : new Response ( "" ) ;
24
+ return response . ok ? response : new Response ( body ) ;
24
25
} catch {
25
- return new Response ( "" ) ;
26
+ return new Response ( body ) ;
26
27
}
27
28
} ,
28
29
log = ( msgs : ( CompilerError | Error | string ) [ ] ) => {
@@ -51,10 +52,8 @@ const addStyle = async (
51
52
) ,
52
53
loadModule = async ( filename : string ) => {
53
54
const { descriptor, errors } = parse (
54
- await ( await fetchText ( filename ) ) . text ( ) ,
55
- {
56
- filename,
57
- } ,
55
+ ( await ( await fetchText ( filename ) ) . text ( ) ) || body ,
56
+ { filename } ,
58
57
) ;
59
58
const compilerOptions : CompilerOptions = { expressionPlugins : [ ] } ,
60
59
scriptBlocks = [ "script" , "scriptSetup" ] ,
You can’t perform that action at this time.
0 commit comments