-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
The typeORMService instances is empty on $afterRoutesInit. #509
Comments
No, there he said that the onafterinit not called at all. |
ok i'll check this problem ASAP |
Hello @yantrab, I added a working example with TypeORM on this repository, it works and I've the TypeORMService in the afterRoutesInit. You can checkout the example here: Try it and tell me if it works for you. |
I have a similar issue, I have managed to narrow it down to the settings being empty. import * as TYPEORM_CONNECTION_OPTIONS from './database.config'
@ServerSettings({
...
typeorm: [TYPEORM_CONNECTION_OPTIONS],
})
export class Server extends ServerLoader {} It seems it has something to do with how the items are loaded. If I log the typeorm settings before the settings decorator everything is defined. |
After much digging, seems |
what is the problem with ts-node 8? if it's just a compilation issue we can fix that. |
I am not sure I didn’t investigate it further than downgrading the package. |
I have the same issue. It works perfectly if I compile it first and then run it with |
@yantrab [2019-01-21T08:14:39.579] [WARN ] [TSED] - Timeout on $onInit hook. Promise are unfulfilled on serviceTypeORMModule In production, the warning will down the server! Hum it means the connection isn't correctly created. My error is, in development mode, the server doesn't throw an error when a promise isn't fullfilled on $onInit hook. It explain why you have an empty connection on $afterRoutesInit. Maybe the delay is too short and the server should wait the promise resolution in any case. I'll fix this problem ASAP. See you |
This might be related: TypeStrong/ts-node#754 |
Information
Description
The typeORMService instances is empty on $afterRoutesInit.
Example
my log:
The text was updated successfully, but these errors were encountered: