Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 如何将pg promise包含在Ionic 3中?运行时错误:";无法读取属性';拆分';“未定义”的定义;_Postgresql_Angular_Typescript_Ionic Framework_Pg Promise - Fatal编程技术网

Postgresql 如何将pg promise包含在Ionic 3中?运行时错误:";无法读取属性';拆分';“未定义”的定义;

Postgresql 如何将pg promise包含在Ionic 3中?运行时错误:";无法读取属性';拆分';“未定义”的定义;,postgresql,angular,typescript,ionic-framework,pg-promise,Postgresql,Angular,Typescript,Ionic Framework,Pg Promise,我正试图用pg promise将我的postgresql数据库连接到爱奥尼亚 我按照TypeScript使用说明将pg promise与TypeScript集成 当我在带有“ionic serve”的服务器上运行此操作时,控制台中出现以下错误: Uncaught TypeError: Cannot read property 'split' of undefined index.js:4 at Object.<anonymous> (index.js:4) at Object.&

我正试图用pg promise将我的postgresql数据库连接到爱奥尼亚

我按照TypeScript使用说明将pg promise与TypeScript集成

当我在带有“ionic serve”的服务器上运行此操作时,控制台中出现以下错误:

Uncaught TypeError: Cannot read property 'split' of undefined  index.js:4 
at Object.<anonymous> (index.js:4)
at Object.<anonymous> (index.js:15)
at __webpack_require__ (bootstrap 25deb0d8315dc2a84252:54)
at Object.148 (main.js:13)
at __webpack_require__ (bootstrap 25deb0d8315dc2a84252:54)
at Object.386 (app.module.ts:61)
at __webpack_require__ (bootstrap 25deb0d8315dc2a84252:54)
at Object.336 (main.ts:5)
at __webpack_require__ (bootstrap 25deb0d8315dc2a84252:54)
at Object.317 (main.js:675)
这是我的配置(tsconfig.json):

以下是我的系统信息:

Ionic Framework: 3.6.0
Ionic App Scripts: 2.1.3
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.11.2
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Mobile 
Safari/537.36
最后,如果我尝试在Android上运行,我会出现以下错误:


您是否正在尝试在客户端运行pg promise?这并不是为了这个,因为pg promise严格来说是一个服务器端包。
{
    "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "dom",
      "es2016"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
    },
    "include": [
       "src/**/*.ts"
    ],
    "exclude": [
    "node_modules"
    ],
    "compileOnSave": false,
    "atom": {
    "rewriteTsconfig": false
    }
}
Ionic Framework: 3.6.0
Ionic App Scripts: 2.1.3
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.11.2
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Mobile 
Safari/537.36