当前位置:  开发笔记 > 前端 > 正文

无法读取未定义的属性'getLineAndCharacterOfPosition'

如何解决《无法读取未定义的属性'getLineAndCharacterOfPosition'》经验,为你挑选了1个好方法。

我遇到了这个错误,有人可以帮助我吗?我刚升级到Angular2.4.3

$ ng serve                                                                                                                                                                              [19:46:01]
** NG Live Development Server is running on http://localhost:4200. **
Hash: ed77e2590987da94e9d9                                                              
Time: 4165ms
chunk    {0} scripts.bundle.js, scripts.bundle.map (scripts) 1.42 MB {4} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.map (styles) 203 kB {4} [initial] [rendered]
chunk    {2} main.bundle.js, main.bundle.map (main) 576 bytes {3} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.map (vendor) 234 kB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]

ERROR in Cannot read property 'getLineAndCharacterOfPosition' of undefined

ERROR in ./src/main.ts
Module build failed: Error: /Users/johntostring/Documents/web-workspace/ng2-qyweb/src/main.ts (3,40): Cannot find module '@angular/platform-browser-dynamic'.)
/Users/johntostring/Documents/web-workspace/ng2-qyweb/src/main.ts (4,32): Cannot find module '@angular/core'.)
    at _checkDiagnostics (/Users/johntostring/Documents/web-workspace/ng2-qyweb/node_modules/@ngtools/webpack/src/loader.js:145:15)
    at /Users/johntostring/Documents/web-workspace/ng2-qyweb/node_modules/@ngtools/webpack/src/loader.js:172:17
 @ multi main
webpack: bundle is now VALID.

main.ts 在此输入图像描述

app.module.ts 在此输入图像描述



1> 小智..:

修改tsconfig.app.jsontsconfig.json使用无效值时会发生这种情况.

推荐阅读
勤奋的瞌睡猪_715
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有