File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ const defaultHotOptions = {
4444 // use absolute file paths to import runtime deps of svelte-hmr
4545 // (see https://github.com/rixo/svelte-hmr/issues/11)
4646 absoluteImports : true ,
47+
48+ // disable runtime error overlay
49+ noOverlay : false ,
4750}
4851
4952const defaultHotApi = 'hot-api-esm.js'
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ export default class ProxyAdapterDom {
1010
1111 this . afterMount = this . afterMount . bind ( this )
1212 this . rerender = this . rerender . bind ( this )
13+
14+ this . _noOverlay = ! ! instance . hotOptions . noOverlay
1315 }
1416
1517 // NOTE overlay is only created before being actually shown to help test
@@ -22,6 +24,7 @@ export default class ProxyAdapterDom {
2224 return this . errorOverlay
2325 }
2426
27+ // TODO this is probably unused now: remove in next breaking release
2528 static renderCompileError ( message ) {
2629 const noCreate = ! message
2730 const overlay = this . getErrorOverlay ( noCreate )
@@ -63,6 +66,7 @@ export default class ProxyAdapterDom {
6366 }
6467
6568 renderError ( err ) {
69+ if ( this . _noOverlay ) return
6670 const {
6771 instance : { debugName } ,
6872 } = this
@@ -71,12 +75,14 @@ export default class ProxyAdapterDom {
7175 }
7276
7377 clearError ( ) {
78+ if ( this . _noOverlay ) return
7479 const overlay = this . constructor . getErrorOverlay ( true )
7580 if ( ! overlay ) return
7681 overlay . clearErrors ( )
7782 }
7883}
7984
85+ // TODO this is probably unused now: remove in next breaking release
8086if ( typeof window !== 'undefined' ) {
8187 window . __SVELTE_HMR_ADAPTER = ProxyAdapterDom
8288}
You can’t perform that action at this time.
0 commit comments