我该如何解决Heroku部署生成错误:静态解析符号值时遇到错误?

时间:2019-04-17 09:35:09

标签: angular heroku

当我尝试使用Heroku CLI部署应用程序时遇到构建错误。这是一个静态错误,日志如下:

    -----> Node.js app detected

    -----> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=true

 -----> Installing binaries
   engines.node (package.json):  8.6.0
   engines.npm (package.json):   5.4.2

   Resolving node version 8.6.0...
   Downloading and installing node 8.6.0...
   Bootstrapping npm 5.4.2 (replacing 5.3.0)...
   npm 5.4.2 installed

-----> Restoring cache
   - node_modules

   -----> Installing dependencies
   Installing node modules (package.json + package-lock)

   > map-the-money-maze@1.0.0 postinstall /tmp/build_0219406a1ec6701654378d3bb4438c73
   > ng build --aot -prod && ./node_modules/.bin/apidoc -i server/api -o public/docs

   Date: 2019-04-17T08:26:29.905Z
   Hash: 1eafd039f11281e38b29
   Time: 4810ms
   chunk {0} styles.3c2cfcf9fb2cfcea49af.bundle.css (styles) 43.2 kB {3} [initial] [rendered]
   chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered]
   chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered]
   chunk {3} inline.22b7623ed7c5ac6f9a35.bundle.js (inline) 1.45 kB [entry] [rendered]

   ERROR in Error: Error encountered resolving symbol values statically. Could not resolve ./segement2/dialogs/customcontentdialog.component relative to /tmp/build_0219406a1ec6701654378d3bb4438c73/src/app/app.module.ts., resolving symbol AppModule in /tmp/build_0219406a1ec6701654378d3bb4438c73/src/app/app.module.ts, resolving symbol AppModule in /tmp/build_0219406a1ec6701654378d3bb4438c73/src/app/app.module.ts
       at syntaxError (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
       at simplifyInContext (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:25111:23)
       at StaticReflector.simplify (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:25123:13)
       at StaticReflector.annotations (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24553:41)
       at NgModuleResolver.resolve (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:14891:70)
       at CompileMetadataResolver.getNgModuleMetadata (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:15546:60)
       at addNgModule (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24403:58)
       at /tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24414:14
       at Array.forEach (<anonymous>)
       at _createNgModules (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24413:26)
       at analyzeNgModules (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24288:14)
       at analyzeAndValidateNgModules (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:24298:35)
       at AotCompiler.analyzeModulesAsync (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler/bundles/compiler.umd.js:23932:46)
       at CodeGenerator.codegen (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
       at Function.NgTools_InternalApi_NG_2.codeGen (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
       at _donePromise.Promise.resolve.then (/tmp/build_0219406a1ec6701654378d3bb4438c73/node_modules/@ngtools/webpack/src/plugin.js:386:44)
       at <anonymous>
   npm ERR! code ELIFECYCLE
   npm ERR! errno 1
   npm ERR! map-the-money-maze@1.0.0 postinstall: `ng build --aot -prod && ./node_modules/.bin/apidoc -i server/api -o public/docs`
   npm ERR! Exit status 1
   npm ERR! 
   npm ERR! Failed at the map-the-money-maze@1.0.0 postinstall script.
   npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /tmp/npmcache.PAeZe/_logs/2019-04-17T08_26_29_942Z-debug.log
  -----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys

   If you're stuck, please submit a ticket so we can help:
   https://help.heroku.com/

   Love,
   Heroku

!推送被拒绝,无法编译Node.js应用。  !推送失败

我知道错误正在我引用“ customcontentdialog”的那一行中出现,但是我不明白这里引用的错误是什么?这使我很难调试代码。有什么建议么?

谢谢

0 个答案:

没有答案
相关问题