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:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
这里的缘故 https://github.com/GitNiko/antTutorial/blob/master/webpack.config.js#L15 把
''
去掉。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.