2017-01-14 69 views
0

我有這個問題幾次,我正在尋求幫助。每當我停止npm啓動並停止我的mongo數據庫時,我正在研究一個使用MEAN堆棧(MongoDB,Express,Angular2和NodeJS)的小示例web應用程序,當我嘗試重新啓動備份時,Chrome會爲我提供「Aw,Snap !」錯誤,因爲「顯示此網頁時出現問題」。它也告訴我:localhost:3000未加載網頁

RangeError: Maximum call stack size exceeded at new ViewWrappedError (eval at (http://localhost:3000/js/app/bundle.js:1740:1), :77:16) at _View_AppComponent0.DebugAppView._rethrowWithContext (eval at (http://localhost:3000/js/app/bundle.js:2651:1), :411:23)

隨着更多的錯誤,所有發生在bundle.js文件。

爲什麼我的應用程序不會在本地主機上啓動的任何想法?下面是bundle.js

/******/ (function(modules) { // webpackBootstrap 
 
/******/ \t // The module cache 
 
/******/ \t var installedModules = {}; 
 

 
/******/ \t // The require function 
 
/******/ \t function __webpack_require__(moduleId) { 
 

 
/******/ \t \t // Check if module is in cache 
 
/******/ \t \t if(installedModules[moduleId]) 
 
/******/ \t \t \t return installedModules[moduleId].exports; 
 

 
/******/ \t \t // Create a new module (and put it into the cache) 
 
/******/ \t \t var module = installedModules[moduleId] = { 
 
/******/ \t \t \t i: moduleId, 
 
/******/ \t \t \t l: false, 
 
/******/ \t \t \t exports: {} 
 
/******/ \t \t }; 
 

 
/******/ \t \t // Execute the module function 
 
/******/ \t \t modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 
 

 
/******/ \t \t // Flag the module as loaded 
 
/******/ \t \t module.l = true; 
 

 
/******/ \t \t // Return the exports of the module 
 
/******/ \t \t return module.exports; 
 
/******/ \t } 
 

 

 
/******/ \t // expose the modules object (__webpack_modules__) 
 
/******/ \t __webpack_require__.m = modules; 
 

 
/******/ \t // expose the module cache 
 
/******/ \t __webpack_require__.c = installedModules; 
 

 
/******/ \t // identity function for calling harmory imports with the correct context 
 
/******/ \t __webpack_require__.i = function(value) { return value; }; 
 

 
/******/ \t // define getter function for harmory exports 
 
/******/ \t __webpack_require__.d = function(exports, name, getter) { 
 
/******/ \t \t Object.defineProperty(exports, name, { 
 
/******/ \t \t \t configurable: false, 
 
/******/ \t \t \t enumerable: true, 
 
/******/ \t \t \t get: getter 
 
/******/ \t \t }); 
 
/******/ \t }; 
 

 
/******/ \t // getDefaultExport function for compatibility with non-harmony modules 
 
/******/ \t __webpack_require__.n = function(module) { 
 
/******/ \t \t var getter = module && module.__esModule ? 
 
/******/ \t \t \t function getDefault() { return module['default']; } : 
 
/******/ \t \t \t function getModuleExports() { return module; }; 
 
/******/ \t \t __webpack_require__.d(getter, 'a', getter); 
 
/******/ \t \t return getter; 
 
/******/ \t }; 
 

 
/******/ \t // Object.prototype.hasOwnProperty.call 
 
/******/ \t __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 
 

 
/******/ \t // __webpack_public_path__ 
 
/******/ \t __webpack_require__.p = "/js/app/"; 
 

 
/******/ \t // Load entry module and return exports 
 
/******/ \t return __webpack_require__(__webpack_require__.s = 579); 
 
/******/ }) 
 
/************************************************************************/ 
 
/******/ ([ 
 
/* 0 */ 
 
/***/ function(module, exports, __webpack_require__) { 
 

 
"use strict"; 
 
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_core__ = __webpack_require__(372);\n/* harmony namespace reexport */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__src_core__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(exports, key, function() { return __WEBPACK_IMPORTED_MODULE_0__src_core__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * @module\n * @description\n * Entry point for all public APIs of the core package.\n */\n\n//# sourceMappingURL=index.js.map//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL34vQGFuZ3VsYXIvY29yZS9pbmRleC5qcz8yMDI2Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgSW5jLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb3JlIHBhY2thZ2UuXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUnO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW5kZXguanMubWFwXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9+L0Bhbmd1bGFyL2NvcmUvaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ=="); 
 

 
/***/ },

+0

我建議你發佈一個最小的測試用例。一些源代碼+配置將會重現這一點。沒有它,你不可能得到有用的答案。 –

回答

1

RangeError: Maximum call stack size exceeded表明存在已調用自身的次數太多遞歸函數。限制是relatively small(10k - 50k)。最有可能的是,它要麼在高度嵌套的數據結構上運行,要麼沒有良好的退出條件。積極嘗試使用if/elseearly returns以避免運行任何不必要的代碼。特別是如果這樣的代碼可能會導致函數再次遞歸。

相關問題