Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeorm TypeError: Cannot read properties of undefined (reading 'type') #10854

Open
1 of 18 tasks
Meddevyahoo opened this issue Apr 26, 2024 · 0 comments
Open
1 of 18 tasks

Comments

@Meddevyahoo
Copy link

Meddevyahoo commented Apr 26, 2024

Issue description

I use typeorm and awesome-cordova-plugins/sqlite/ngx for create and manage sqlite database, I have this error

Expected Behavior

image

code:

` public initDatasIfDBEmpty(datas: any): Promise {
return this.platform.ready().then(() => {
createConnection({
type: 'sqlite',
database: this.dbName,
synchronize: true,
logging: true,
entities: [
User
],
}).then((connection: DataSource) => {
console.log('connection');
console.log(connection);
connection.synchronize().then(() => {

        console.log('here.');
       
    }).catch((error: any)=>{
      console.log('error',error);
    });
  });
});

});
`

this is package.json:

{ "name": "front-v2", "version": "0.0.1", "author": "Ionic Framework", "homepage": "https://ionicframework.com/", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", "test": "ng test", "lint": "ng lint", "postinstall": "ngcc" }, "private": true, "dependencies": { "@angular/animations": "^15.2.10", "@angular/common": "^15.2.10", "@angular/compiler": "^15.2.10", "@angular/core": "^15.2.10", "@angular/forms": "^15.2.10", "@angular/platform-browser": "^15.2.10", "@angular/platform-browser-dynamic": "^15.2.10", "@angular/router": "^15.2.10", "@awesome-cordova-plugins/core": "^6.6.0", "@awesome-cordova-plugins/device": "^6.6.0", "@awesome-cordova-plugins/network": "6.6.0", "@awesome-cordova-plugins/splash-screen": "6.6.0", "@awesome-cordova-plugins/sqlite": "6.6.0", "@awesome-cordova-plugins/status-bar": "^6.7.0", "@capacitor/network": "^5.0.7", "@capacitor/splash-screen": "^5.0.7", "@capacitor/status-bar": "^5.0.7", "@ionic/angular": "^6.7.5", "@ionic/cli": "^6.20.9", "@ionic/cordova-builders": "^11.0.0", "@ionic/storage": "4.0.0", "cordova": "^12.0.0", "cordova-plugin-device": "^2.0.3", "cordova-plugin-statusbar": "^2.4.3", "cordova-res": "^0.15.4", "cordova-sqlite-storage": "^6.1.0", "core-js": "^3.36.0", "flickity": "3.0.0", "font-awesome": "4.7.0", "intl": "^1.2.5", "karma": "^6.0.0", "karma-chrome-launcher": "^3.2.0", "karma-coverage-istanbul-reporter": "^3.0.3", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^1.7.0", "reflect-metadata": "^0.2.2", "sqlite3": "^5.1.7", "typeorm": "^0.3.20", }, "devDependencies": { "@angular-devkit/build-angular": "^15.0.0", "@angular-eslint/builder": "^15.0.0", "@angular-eslint/eslint-plugin": "^15.0.0", "@angular-eslint/eslint-plugin-template": "^15.0.0", "@angular-eslint/schematics": "^15.0.0", "@angular-eslint/template-parser": "^15.0.0", "@angular/cli": "^15.2.10", "@angular/compiler-cli": "^15.0.0", "@angular/language-service": "^15.0.0", "@ionic/angular-toolkit": "^9.0.0", "@types/events": "^3.0.3", "@types/node": "^14.18.63", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "babel-plugin-react-native-web": "^0.19.10", "coffeescript": "^1.12.7", "cordova-android": "^12.0.1", "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-inappbrowser": "^5.0.0", "cordova-plugin-ionic-keyboard": "^2.0.5", "cordova-plugin-ionic-webview": "^5.0.0", "cordova-plugin-network-information": "^3.0.0", "cordova-plugin-splashscreen": "5.0.2", "cordova-plugin-whitelist": "^1.3.4", "eslint": "^7.26.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "30.7.6", "eslint-plugin-prefer-arrow": "1.2.2", "typescript": "~4.9.3" }, "description": "ASTUCE project", "cordova": { "plugins": { "cordova-plugin-statusbar": {}, "cordova-plugin-device": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-ionic-webview": {}, "cordova-plugin-ionic-keyboard": {}, "ionic-plugin-keyboard": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-network-information": {}, "cordova-plugin-inappbrowser": {}, "cordova-sqlite-storage": {} }, "platforms": [] } }

Actual Behavior

how to resolve this error please

Steps to reproduce

and thanks for advance

My Environment

Dependency Version
Operating System android
Node.js version 16
Typescript version 4.9.3
TypeORM version 0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant