Hookyns / tst-reflect

Advanced TypeScript runtime reflection system
MIT License
328 stars 11 forks source link

Is there a way to use it with nestjs [Question] #91

Open KaimDev opened 9 months ago

KaimDev commented 9 months ago

Hello, I loved this tool but I have had quite a few problems when using it with the Nestjs compiler: nest

[ERR] tst-reflect: You call getType() method directly. You have probably wrong configuration, because tst-reflect-transformer package should replace this call by the Type instance.
If you have right configuration it may be BUG so try to create an issue.
If it is not an issue and you don't want to see this debug message, create field 'tst-reflect-disable' in global object (window | global | globalThis) eg. `window['tst-reflect-disable'] = true;

I don't know if there is already a way to implement it with nestjs or if there will be support in the future.

I would be very grateful if you could tell me a correct way to configure the project with the library, thank you very much

Hookyns commented 9 months ago

Related to https://github.com/Hookyns/tst-reflect/issues/75

There are issues with nest cmd. My reaction in the linked issue:

So you have to use build: npx ttsc, start: node dist/main and there should be no problem.

Or second option is to use ts-patch, which will override typescript package so the "native" tsc cmd will invoke compilation with transformer, every time. So you can use nest build and nest start cmds.