当我使用新版本的Jhipster创建用于生产的应用程序时,它不再告诉我文件中的确切错误行:
在这一步中给出的错误是:
npm run webpack:prodERROR in src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3972): Object is possibly 'null'.
src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3677): Object is possibly 'null'.
src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3833): Object is possibly 'null'.这些错误告诉我很好,但是(3972,3677,3833)行与我的文件中的那些不对应。不仅对于这个特定的案例,而且对于所有在开发过程中出现的人,我需要知道我的文件中的确切行。
如何检测文件的确切行中的错误?
node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"
(node:9047) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
Hash: 8de665ac5fd05610ed73
Version: webpack 4.41.2
Time: 4521ms
Built at: 2020-02-11 19:03:53
6 assets
Entrypoint polyfills = app/polyfills.8de665ac5fd05610ed73.bundle.js
Entrypoint global = content/global.b97cbe1779ef2c8c2587.css app/global.8de665ac5fd05610ed73.bundle.js
Entrypoint main = app/main.8de665ac5fd05610ed73.bundle.js
[0] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
factory:2344ms building:1835ms = 4179ms
[1] ./src/main/webapp/content/scss/global.scss 39 bytes {0} [built]
factory:2252ms building:414ms = 2666ms
[2] ./src/main/webapp/app/app.main.ts 0 bytes {1} [built]
factory:2344ms building:1836ms = 4180ms
+ 1 hidden module
ERROR in src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3972): Object is possibly 'null'.
src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3677): Object is possibly 'null'.
src/main/webapp/app/admin/user-management/user-management-update.component.html(1,3833): Object is possibly 'null'.发布于 2020-02-12 16:02:21
在一件一件地做完之后,是这样的:
//之后
*ngIf="editForm.get('root').value == false" // NOW
*ngIf="editForm.get('root')?.value == false" 有必要加上"?“因为在打包PRO时它会失败,但它不能很好地告诉您行,因为错误发生在缩小PRO之后
https://stackoverflow.com/questions/60169935
复制相似问题