-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Maximum call stack size exceeded in webpack build with 3.14.0 version #5098
Comments
same issue, plz fix it ASAP |
@dimitriylol the part of report that you've replaced with
It even provided steps to produce a proper test case without third party libraries:
Please fill them out as required, otherwise I have no way to move forward on this. |
@alexlamsl fair enough. I can't give the whole code but I'll try to create a minimal repo to reproduce the issue. I'll do it later today (in 6-7 hours). |
I couldn't create the minimal repo to reproduce because I can't print uglify options. Here is what I got: JavaScript input: var setPrototypeOf = require("./setPrototypeOf.js");
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
setPrototypeOf(subClass, superClass);
}
module.exports = _inheritsLoose;
module.exports["default"] = module.exports, module.exports.__esModule = true; The The uglifyjs CLI command executed or minify() options used: I failed to find the exact uglifyjs option that leads to the error. When I use the suggestion of exporting { warnings: undefined,
parse:
{ toplevel:
{ globals: [Object],
uses_eval: false,
uses_with: false,
body: [Array],
enclosed: [Array],
functions: [Object],
make_def: [Function],
parent_scope: null,
variables: [Object],
start: [Object],
end: [Object],
_squeezed: true,
_optimized: true,
_var_names: [Object],
to_mangle: [] },
filename: 'static/js/main.9e685cd4.js' },
compress: {},
mangle: true,
output:
{ shebang: true,
comments: /^\**!|@preserve|@license|@cc_on/i,
beautify: false,
semicolons: true },
sourceMap: true,
toplevel: undefined,
nameCache: undefined,
ie8: undefined,
keep_fnames: undefined } I can't print import uglifyJs from 'uglify-js'
import fs from 'fs'
const uglifyOptions = {
warnings: undefined,
compress: {},
mangle: true,
output:
{
shebang: true,
comments: /^\**!|@preserve|@license|@cc_on/i,
beautify: false,
semicolons: true
},
sourceMap: true,
toplevel: undefined,
nameCache: undefined,
ie8: undefined,
keep_fnames: undefined
}
const { code } = uglifyJs.minify({
'jss.esm.js': fs.readFileSync('./node_modules/jss/dist/jss.esm.js').toString()
}, uglifyOptions);
fs.writeFileSync('after_uglify.js', code) I can launch @alexlamsl please clarify maybe there is another way to get those options? Maybe is there a simple way to compare minified files with/without |
same issue, another sample case: ./package.json {
"dependencies": {
"@babel/core": "^7.14.8",
"@babel/preset-env": "^7.14.8",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.46.0",
"webpack-cli": "^4.7.2"
},
"scripts": {
"build": "webpack"
}
} index.js require('@babel/runtime/helpers/extends')({},{}) webpack.config.js const UglifyWebpackPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
mode: 'production',
entry: './index.js',
optimization: {
minimizer: [
new UglifyWebpackPlugin(),
],
}
} .babelrc {
"presets": ["@babel/preset-env"]
} |
Did you follow the instructions for Here's an example from a prior report: Meanwhile, if @bruce007lee and others can provide actionable information as well that would also help in resolving this "ASAP". |
@mycoin please follow #5098 (comment) and provide a runnable test case. |
code from const cModules = {}
function _extends() {
cModules.exports = _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
};
console.log('>>', _extends({}, {ok: 1})); |
@mycoin for future reference, if you follow the instructions with: $ export UGLIFY_BUG_REPORT=1
$ npm run build You would get the follwoing // UGLIFY_BUG_REPORT
// {
// "parse": {},
// "compress": {},
// "mangle": true,
// "output": {
// "shebang": true,
// "comments": {},
// "beautify": false,
// "semicolons": true
// },
// "sourceMap": null
// }
//-------------------------------------------------------------
// main.js
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 154:
/***/ ((module) => {
function _extends() {
module.exports = _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
module.exports.default = module.exports, module.exports.__esModule = true;
return _extends.apply(this, arguments);
}
module.exports = _extends;
module.exports.default = module.exports, module.exports.__esModule = true;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__(154)({},{})
})();
/******/ })()
; which contains all the necessary information to reproduce the bug with |
@alexlamsl thanks for the fix! |
Patch released in |
Uglify version (
uglifyjs -V
): 3.14.0JavaScript input: n/a
The
uglifyjs
CLI command executed orminify()
options used. n/aJavaScript output or error produced.
The error stack trace from browser:
setPrototypeOf is
@babel/runtime/helpers/setPrototypeOf.js
.Related to build packages and their version:
Webpack plugin usage:
As a workaround I added
"uglify-js": "3.13.10"
to my package.json to overrule dependencies fromuglifyjs-webpack-plugin
:If I miss adding the required information about steps to reproduce the issue, please let me know.
The text was updated successfully, but these errors were encountered: