Skip to content

Commit

Permalink
fix: manually test global regex codeframeRE index (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo committed Jan 20, 2021
1 parent e6c8478 commit 20d6c0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vite/src/client/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class ErrorOverlay extends HTMLElement {
this.root = this.attachShadow({ mode: 'open' })
this.root.innerHTML = template

codeframeRE.lastIndex = 0
const hasFrame = err.frame && codeframeRE.test(err.frame)
const message = hasFrame
? err.message.replace(codeframeRE, '')
Expand Down

0 comments on commit 20d6c0f

Please sign in to comment.