TS 完全在线错误(Jhipster 6.7.0)
TS errors online exactly ( Jhipster 6.7.0 )
当我使用新版本的 Jhipster 创建生产应用程序时,它不再告诉我文件中的确切错误行:
这一步给我的错误:
npm run webpack:prod
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'.
错误告诉我很好,但行 (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'.
一段一段的走完之后是这样的:
// 之后
*ngIf="editForm.get('root').value == false"
// 现在
*ngIf="editForm.get('root')?.value == false"
需要加“?”因为在为 PRO 打包时它会失败,但它并没有告诉你该行,因为错误发生在为 PRO
缩小之后
当我使用新版本的 Jhipster 创建生产应用程序时,它不再告诉我文件中的确切错误行:
这一步给我的错误:
npm run webpack:prod
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'.
错误告诉我很好,但行 (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'.
一段一段的走完之后是这样的:
// 之后
*ngIf="editForm.get('root').value == false"
// 现在
*ngIf="editForm.get('root')?.value == false"
需要加“?”因为在为 PRO 打包时它会失败,但它并没有告诉你该行,因为错误发生在为 PRO
缩小之后