angular2-contacts-demo icon indicating copy to clipboard operation
angular2-contacts-demo copied to clipboard

import {ContactService} from 'shared/contact.service';

Open liudianliang opened this issue 7 years ago • 4 comments

import {ContactService} from 'shared/contact.service'; 这段代码报错,貌似不影响运行 [ts] Cannot find module 'shared/contact.service'.

liudianliang avatar Feb 20 '17 02:02 liudianliang

HI ~ 这是编译时期抛出的错误?我在本地试了下,编译正常,运行也正常,没有报错。 你本地的 webpack 和 TypeScript 版本是?

ghost avatar Feb 20 '17 11:02 ghost

看起来是模块解析异常了,重新拿一下代码试试。

crazybber avatar Feb 21 '17 02:02 crazybber

......貌似在vsc上报的错,我尝试加了../就不报错了

HotEvent avatar Mar 05 '17 00:03 HotEvent

有人抛出过这个问题:http://stackoverflow.com/questions/38044010/make-vs-code-read-webpack-config-and-recognize-path-with-alias

可以试试他提供的方法

ghost avatar Mar 05 '17 07:03 ghost