Ionic 4 SQLite-TypeError:Object(…)不是函数 [英] Ionic 4 SQLite - TypeError: Object(…) is not a function

查看:76
本文介绍了Ionic 4 SQLite-TypeError:Object(…)不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ionic 4 Beta版本.当我添加cordova-sqlite-storage插件并尝试打开数据库时,出现以下控制台错误.

I'm using ionic 4 beta version. When I added the cordova-sqlite-storage plugin and tried to open the database, I got the following console error.

TypeError: Object(...) is not a function[Learn More] index.js:125
./node_modules/@ionic-native/sqlite/index.js/SQLiteObject<     index.js:125
./node_modules/@ionic-native/sqlite/index.js                   index.js:25
__webpack_require__                                            bootstrap:81
./src/app/services/x.service.ts                                http://localhost:8100/main.js:5168:78
__webpack_require__                                            bootstrap:81
./src/app/services/y.service.ts                                http://localhost:8100/main.js:4977:75
__webpack_require__                                            bootstrap:81
./src/app/components/c.component.ts                            http://localhost:8100/main.js:549:100
__webpack_require__                                            bootstrap:81
./src/app/app.module.ts                                        http://localhost:8100/main.js:250:87
__webpack_require__                                            bootstrap:81
./src/main.ts                                                  http://localhost:8100/main.js:5837:73
__webpack_require__                                            bootstrap:81
0                                                              http://localhost:8100/main.js:5860:18
__webpack_require__                                            bootstrap:81
checkDeferredModules                                           bootstrap:43
webpackJsonpCallback                                           bootstrap:30
<anonymous>                                                    http://localhost:8100/main.js:1:2

我的依赖项如下:

"dependencies": {
    "@angular/common": "6.0.9",
    "@angular/core": "6.0.9",
    "@angular/forms": "6.0.9",
    "@angular/http": "6.0.9",
    "@angular/platform-browser": "6.0.9",
    "@angular/platform-browser-dynamic": "6.0.9",
    "@angular/router": "6.0.9",
    "@ionic-native/core": "5.0.0-beta.14",
    "@ionic-native/splash-screen": "5.0.0-beta.14",
    "@ionic-native/sqlite": "^4.11.0",
    "@ionic-native/status-bar": "5.0.0-beta.14",
    "@ionic/angular": "4.0.0-beta.0",
    "@ionic/ng-toolkit": "1.0.0",
    "@ionic/schematics-angular": "1.0.1",
    "@types/lodash": "^4.14.114",
    "cordova-sqlite-storage": "^2.4.0",
    "core-js": "^2.5.3",
    "ionicons": "^2.0.1",
    "rxjs": "6.2.2",
    "rxjs-compat": "^6.2.2",
    "zone.js": "^0.8.26"
  },

我用来创建/打开数据库的代码来自离子文档

The code I was following to create/open the database is from ionic documentation.

推荐答案

检查此内容:基本上,您需要使用插件的5.0.0-beta.14版本

Basically you need to use version 5.0.0-beta.14 of the plugin

这篇关于Ionic 4 SQLite-TypeError:Object(…)不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆