Terser: Version 4.0.1 breaks sourcemap and throws an error

Created on 30 Jun 2019  路  5Comments  路  Source: terser/terser

Bug report or Feature request?

Version (complete output of terser -V or specific git commit)

4.0.1

Complete CLI command or minify() options used

I haven't found the actual cause yet but there are bug reports from Vue CLI & Gatsby claiming fresh installs failed due to a source map error, and can be fixed by downgrading terser to v4.0.0 (tested in the Vue CLI project).

Related:
https://github.com/vuejs/vue-cli/issues/4210
https://github.com/gatsbyjs/gatsby/issues/15249

Most helpful comment

:/ This issue has reached my attention and I'll be temporarily reverting the offending PR.

Thanks @sodatea for investigating the precise cause of the bug down to the commit hash :heart: it's very appreciated.

All 5 comments

ping @fabiosantoscode

Current yarn workaround is to add the following inside your package.json file:

"resolutions": {
  "terser": "4.0.0"
}

I don't know of an equivalent for npm but there's likely something~

I encountered this issue related by webpacker (ruby wrap webpack).
The version of terser has been changed to 4.0.1 => 4.0.0.
yarn add [email protected]
I hope this bug is fixed.

:/ This issue has reached my attention and I'll be temporarily reverting the offending PR.

Thanks @sodatea for investigating the precise cause of the bug down to the commit hash :heart: it's very appreciated.

Was this page helpful?
0 / 5 - 0 ratings