Skip to content

Commit

Permalink
fix: json plugin error report line regex (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
HChange committed Jan 26, 2021
1 parent 32413ce commit 35e1f52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/json.ts
Expand Up @@ -61,7 +61,7 @@ export function jsonPlugin(
map: { mappings: '' }
}
} catch (e) {
const errorMessageList = /[\d]/.exec(e.message)
const errorMessageList = /[\d]+/.exec(e.message)
const position = errorMessageList && parseInt(errorMessageList[0], 10)
const msg = position
? `, invalid JSON syntax found at line ${position}`
Expand Down

0 comments on commit 35e1f52

Please sign in to comment.