Ionic Uncaught Error: Cannot find module “.” when importing a service provider

心不动则不痛 提交于 2019-11-29 04:36:52

I finally figure it out to solve the problem. The error occurs when I import the events from ionic-angular.

So instead of: import { Events } from 'ionic-angular/umd';

Just remove the umd at the end. I don't know why it happened because I am using auto import from my vs code.

I changed import { Events } from 'ionic-angular/umd'; to import { Events } from 'ionic-angular';. I was using "typescript": "~2.6.2". I tried to change the version of typescript and I have heard that typescript 3.1 can be fix in some cases. In my case once i went higher than typescript 2.8.0 I started getting other issues related to ionic. At the end the above fix works, and I think this is more a ionic framework issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!