ionic Error: Cannot find module "."
程序员文章站
2022-03-03 19:21:07
...
使用VScode开发ionic移动应用时,碰到如下错误:
Uncaught Error: Cannot find module "."
at webpackMissingModule (index.js:3)
at e.code (index.js:3)
at Object.<anonymous> (index.js:9)
at __webpack_require__ (bootstrap 62d6a5897825ac327001:54)
at Object.690 (slide.transition.ts:67)
at __webpack_require__ (bootstrap 62d6a5897825ac327001:54)
at Object.495 (main.js:1885)
at __webpack_require__ (bootstrap 62d6a5897825ac327001:54)
at Object.487 (notification-api.ts:6)
at __webpack_require__ (bootstrap 62d6a5897825ac327001:54)
NavController、ModalController等
就报错,经网上查询,终于看到了答案,原因就是在写NavController时,IDE提示从“ionic-angular/umd”导入,就直接用了,正是这个“umd”造成的错误,把从“ionic-angular/umd”导入
import { NavController } from 'ionic-angular/umd';
改为从“ionic-angular"导入
import { NavController } from 'ionic-angular';
就Ok了具体原因不明,有了解的朋友请赐教!
推荐阅读
-
编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
-
webpack-dev-server config.js Cannot find module
-
cannot find supercluster & native module cannot be null & Xcode build timeout
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
【已解决】运行webpack-dev-server时提示Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
-
webpack5: Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Webpack 报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack-dev-server 报错 Error: Cannot find module ‘webpack/bin/config-yargs‘
-
webpack——Error: Cannot find module ‘webpack-cli/bin/config-yargs‘