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

Examples and configuration using ormconfig.json #10

Closed
generalpiston opened this issue Nov 26, 2017 · 5 comments
Closed

Examples and configuration using ormconfig.json #10

generalpiston opened this issue Nov 26, 2017 · 5 comments

Comments

@generalpiston
Copy link
Owner

No description provided.

@manuhortet
Copy link

manuhortet commented Mar 13, 2019

Tried adding "node_modules/typeorm-encrypted/src/subscribers/AutoEncryptSubscriber.ts" to subscribers in my ormconfig.json and didn't work. Any clue about how this must be done?

Error:

import { EventSubscriber, EntitySubscriberInterface, InsertEvent, UpdateEvent } from "typeorm";
       ^

SyntaxError: Unexpected token 

@generalpiston
Copy link
Owner Author

@manuhortet it seems like there's an issue with tsconfig.json. You'll likely have to make that file available using the files property: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html.

@manuhortet
Copy link

Added the path to files in tsconfig.json and it now finds the file (had to change my "scripts": { "start": } to avoid using ts-node src/index.ts, which will ignore tsconfig.json.

Anyway, now with:

"scripts": {
    "start": "tsc && node src/index.ts"
}

I'm getting:

node_modules/typeorm/common/DeepPartial.d.ts(5,27): error TS1005: ';' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,47): error TS1005: ';' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,50): error TS1109: Expression expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,74): error TS1005: '(' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,81): error TS1005: ',' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,109): error TS1005: ',' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,112): error TS1109: Expression expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,144): error TS1005: '(' expected.
node_modules/typeorm/common/DeepPartial.d.ts(5,163): error TS1005: '(' expected.
node_modules/typeorm/common/DeepPartial.d.ts(6,1): error TS1128: Declaration or statement expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,27): error TS1005: ';' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,47): error TS1005: ';' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,50): error TS1109: Expression expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,85): error TS1005: '(' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,92): error TS1005: ',' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,120): error TS1005: ',' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,123): error TS1109: Expression expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,166): error TS1005: '(' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,197): error TS1005: '(' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(11,213): error TS1005: ')' expected.
node_modules/typeorm/query-builder/QueryPartialEntity.d.ts(12,1): error TS1128: Declaration or statement expected.
error Command failed with exit code 2.

I'm new with TS and pretty lost here. I guess this is not a problem with typeorm-encrypted and its use anymore, but something about how I'm compiling / running things here.

@generalpiston
Copy link
Owner Author

Hey man, no problem... it seems like you're using typescript incorrectly. I would try https://www.npmjs.com/package/ts-node. I usually use it this way: node -r ts-node/register src/index.ts.

If you need more help, feel free to find me on telegram: @generalpiston .

@generalpiston
Copy link
Owner Author

Less necessary with Transformers in #14 .

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

No branches or pull requests

2 participants