ionic3 报错 Uncaught Error: Cannot find module "."

index.js:3 Uncaught Error: Cannot find module "."

    at webpackMissingModule (index.js:3)

    at Object.defineProperty.value (index.js:3)

    at Object. (index.js:9)

    at __webpack_require__ (bootstrap cdcdbc7d225d726ecde0:54)

    at Object.686 (main.js:1572)

    at __webpack_require__ (bootstrap cdcdbc7d225d726ecde0:54)

    at Object.158 (main.js:666)

    at __webpack_require__ (bootstrap cdcdbc7d225d726ecde0:54)

    at Object.685 (app.module.ts:96)

    at __webpack_require__ (bootstrap cdcdbc7d225d726ecde0:54)


解决方法:

把import { NavController } from 'ionic-angular/umd';

改成import { NavController } from 'ionic-angular';

如果用的是本地服务,刷新之后还不是行,需要重新启动项目。ionic serve 再刷新网址即可

你可能感兴趣的:(ionic3 报错 Uncaught Error: Cannot find module ".")