Open chiarelli opened 7 years ago
I can reproduce the second error. I'm investigating into this to fix the bug.
In the meantime, you can use orm-js@0.1.6
(current version is orm-js@0.2.1
), that should work for now.
$ npm install orm-js@0.1.6
The strange thing about error 1. is that instances of "SqliteDatabase" is an "AbstractDatabase" type, but even then, a compiler error occurs (Could the error be in the "tsconfig.json" configuration?)
I'm going to downgrade and I'll report back to you later.
Regarding the code of yours is written in es6 my compiler is presenting the following error:
/home/raphael/wokspace-VSCode/test_ormtypescript/node_modules/orm-js/orm.js:10 const changeCase = require('change-case'); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Module._extensions..js (module.js:474:10) at Object.require.extensions.(anonymous function) [as .js] (/home/raphael/wokspace-VSCode/test_ormtypescript/node_modules/babel-cli/node_modules/babel-register/lib/node.js:152:7) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.
(/home/raphael/wokspace-VSCode/test_ormtypescript/source/persistence/connection.js:38:11) at Module._compile (module.js:456:26) at loader (/home/raphael/wokspace-VSCode/test_ormtypescript/node_modules/babel-cli/node_modules/babel-register/lib/node.js:144:5) [nodemon] app crashed - waiting for file changes before starting...
I believe this error is on my side, but would you have any solution for me to run javascript-es6 on my nodejs?
I've already used babel to do the transpilation for es5, but it only solves for my code. If there was a js-ES6 code in the dependencies (node_modules) the error persists (or am I not setting babel to run correctly?)
I downgraded to orm-js@0.1.6 version, but received the following error:
[16:07:36] Using gulpfile ~/wokspace-VSCode/test_ormtypescript/gulpfile.js [16:07:36] Starting 'default'... [16:07:36] Starting 'lint'... [16:07:37] Finished 'lint' after 440 ms [16:07:37] Starting 'build'... [16:07:37] Starting 'build-app'... [16:07:37] Starting 'build-test'... [16:07:39] Finished 'build-test' after 2.5 s source/entities/pessoa.ts(6,10): error TS2339: Property 'field' does not exist on type 'typeof "/home/raphael/wokspace-VSCode/test_ormtypescript/node_modules/orm-js/decorators"'.
It's strange. SqliteDatabase is a subclass of AbstractDatabase, I'm unsure why this is occurring now. I've checked an older project of mine, that uses orm-js@0.1.6
and orm-js-sqlite@0.1.2
.
I'll do further investigations tomorrow. Thank you for trying out my unstable module and giving me feedback :-)
I was running the example: README.md, however the following errors occurred:
1. I was trying to connect to a database and it was this error that launched:
2. My compiler complained about this snippet of code: