question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximum call stack size exceeded

See original GitHub issue

这是可重现的 repo https://github.com/GitNiko/antTutorial
我觉得是components/_util/warning.js下引用引起的
这是编译后的

'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _warning = require('warning');
// var _warning = require('warning/warning.js');  改成这个后再在项目里引用antd后编译就不会出问题
// 因为本身文件名就是warning.js这样babel的时候会产生引用自己的问题。

var _warning2 = _interopRequireDefault(_warning);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var warned = {};

exports["default"] = function (valid, message) {
    if (!valid && !warned[message]) {
        (0, _warning2["default"])(false, message);
        warned[message] = true;
    }
};

module.exports = exports['default'];

这是在项目中引用有最新版本的antd的时候编译出来的结果

/* 360 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
	    value: true
	});

	var _warning = __webpack_require__(360);// 360其实就是自己了

	var _warning2 = _interopRequireDefault(_warning);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

	var warned = {};

	exports["default"] = function (valid, message) {
	    if (!valid && !warned[message]) {
	        (0, _warning2["default"])(false, message);
	        warned[message] = true;
	    }
	};

修正后的结果

/* 360 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
	    value: true
	});

	var _warning = __webpack_require__(912); // 没有引用自己了

	var _warning2 = _interopRequireDefault(_warning);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

	var warned = {};

	exports["default"] = function (valid, message) {
	    if (!valid && !warned[message]) {
	        (0, _warning2["default"])(false, message);
	        warned[message] = true;
	    }
	};

	module.exports = exports['default'];

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
yesmeckcommented, Nov 24, 2016
0reactions
lock[bot]commented, May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
Maximum call stack size exceeded error ... This error is almost always means you have a problem with recursion in JavaScript code, as...
Read more >
How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found