Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Couldn't parse bundle asset "vendors~typeahead.chunk.min.js". Analyzer will use module sizes from stats file. #261

Closed
Legends opened this issue Mar 16, 2018 · 12 comments · Fixed by #268

Comments

@Legends
Copy link

Legends commented Mar 16, 2018

Plugin version 1.2.4
webpack 4

This only happens in production when setting sourceMap: false, when set to true, it runs fine!

 new UglifyJsPlugin({ 
            sourceMap: false, // <-- using false here, generates the error above
            uglifyOptions: {
                ecma: 5,
                warnings: true
            }
        })

Here the complete Log-file:
2018-03-16T16_31_25_817Z-debug.log

@alexander-akait
Copy link
Member

@Legends can you provide more detailed log, because log above contain only npm stacktrace

@Legends
Copy link
Author

Legends commented Mar 16, 2018

npm run prod

here it is: --> uglify-sourcemap-false-production.log

@alexander-akait
Copy link
Member

@Legends problem in source-map package. It is hard debug without source 😞 Need reproducible test repo

@Legends
Copy link
Author

Legends commented Mar 16, 2018

Moved the issue to source-maps repo.

Will try to create a setup and post it there.

@Legends Legends closed this as completed Mar 16, 2018
@Legends
Copy link
Author

Legends commented Mar 17, 2018

Here is the repo which replicates the error.

I have opened a new issue here

@Legends Legends reopened this Mar 17, 2018
@alexander-akait
Copy link
Member

@Legends I will investigate this in near future 👍

@Legends
Copy link
Author

Legends commented Mar 19, 2018

packages.json

One question upfront: Is -p and --mode production the same?

 "scripts": {
    "prod": "webpack --mode production --display-modules --progress --display-error-details",

I think the issue arises because I have set

module.exports = {
    devtool: 'source-map',

but in the UglifyJS-Plugin I set it to false:

new UglifyJsPlugin({ 
            sourceMap: false,

Perhaps an error message would be nice, that explains the issue or the plugin overrides devtool setting by default.
The problem is created in UglifyJS-webpack-plugin:

var _asset$sourceAndMap = asset.sourceAndMap(),
    source = _asset$sourceAndMap.source,
    map = _asset$sourceAndMap.map; // <--- returns null

input = source;
inputSourceMap = map; // inputSourceMap  is now null

sourceMap = new _sourceMap.SourceMapConsumer(inputSourceMap); // fails

@Legends
Copy link
Author

Legends commented Mar 19, 2018

@pbrain19 has the same error msg, but he uses a different configuration here

@Legends
Copy link
Author

Legends commented Mar 21, 2018

@evilebottnawi What needs to be done here? Can I help somehow?

@alexander-akait
Copy link
Member

@Legends no, WIP 👍

@alexander-akait
Copy link
Member

@Legends bug, work on PR. Thanks!

@alexander-akait
Copy link
Member

Fixed in #268

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

Successfully merging a pull request may close this issue.

2 participants