Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source map + minimizer results in silent failure #100

Closed
underflow00 opened this issue Jun 29, 2019 · 13 comments
Closed

Source map + minimizer results in silent failure #100

underflow00 opened this issue Jun 29, 2019 · 13 comments

Comments

@underflow00
Copy link

underflow00 commented Jun 29, 2019

  • Operating System: Win 10
  • Node Version: 10.15.3
  • NPM Version: 6.4.1
  • webpack Version: 4.35.0
  • terser-webpack-plugin Version: 1.3.0

Expected Behavior

Using source map with minimizer created a minified file with a source map.

Actual Behavior

Using source map with minimizer causes silent failure. Output file not created. No console output.

How Do We Reproduce?

  1. Create empty file 1.js
  2. Create webpack.config.js file with contents:
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
    devtool:  'source-map',
    entry: './1.js',
    resolve: {
        extensions: ['.js']
    },
    output: {
        filename: 'main.js',
        path: __dirname,
    },
    optimization: {
        minimize: true,
        minimizer: [
            new TerserPlugin({
                sourceMap: true,
            }),
        ],
    }
};
  1. Run webpack --config webpack.config.js
@underflow00
Copy link
Author

It works after downgrading terser-webpack-plugin to v1.2.4. Something to do with the terser upgrade? Or is it a caching problem?

@wallzero
Copy link

I am running into this as well. It looks like #101 is also.

@alexander-akait
Copy link
Member

Please create minimum reproducible test repo

@alexander-akait
Copy link
Member

Looks like problem in terser

@p3x-robot
Copy link

here is the the error:

git clone https://github.com/patrikx3/redis-ui-material
npm install
# now in the src/builder/webpack.config.js file, rename sourceMap: false to sourceMap: true
# and there are you with the error
npm run build

@alexander-akait
Copy link
Member

@p3x-robot thanks, i will look on this in near future

@alexander-akait
Copy link
Member

Problem in latest terser release terser/terser#382

@underflow00
Copy link
Author

That terser issue won't be fixed anytime soon. You should revert it here.

@p3x-robot
Copy link

which version i should revert to ?

@p3x-robot
Copy link

well, there is a new build on terser-js/terser, but i can perfectly uglify with it, i only get this error in the terser-webpack-plugin

@p3x-robot
Copy link

actually now it works, as it is a patch and it auto upgrades it to 4.0.2 and the sourcemaps are ok!

@p3x-robot
Copy link

terser 4.0.0 was bad, 4.0.2 is good, so there is nothing to do, just npm install again and you will be upgraded to terser 4.0.2 automatically

@alexander-akait
Copy link
Member

Closed, update deps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants