kugacz / nj-request-scope

Performant request scope dependency injection for NestJS framework using express server
MIT License
22 stars 7 forks source link

NotImplementedException when using @RequestScope() #4

Closed AltarBeastiful closed 2 years ago

AltarBeastiful commented 2 years ago

I'm getting compilation error when using @RequestScope() decorator. Is there a missing part I should implement to use this ?

node_modules/nj-request-scope/lib/util/dynamic.object.handler.factory.js:27
            throw new NotImplementedException();
                  ^
Error: Not implemented. Feel free to implement.
    at Object.getPrototypeOf (//node_modules/nj-request-scope/lib/util/dynamic.object.handler.factory.js:27:19)
    at Function.[Symbol.hasInstance] (<anonymous>)
    at mapToProxy (node_modules/@nestjs/core/nest-factory.js:167:35)
    at Proxy.<anonymous> (//node_modules/@nestjs/core/nest-factory.js:182:32)
    at bootstrap (/src/main.ts:39:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
kugacz commented 2 years ago

Hi @AltarBeastiful, Initially, I implemented only those Proxy methods I needed. The rest of them are throwing a "Not implemented. Feel free to implement" error. I've prepared a new version of nj-request-scope with 'getPrototypeOf' implementation, which you need. Please, try the new release candidate version: 1.0.4-rc.0 and let me know if all is working properly.

AltarBeastiful commented 2 years ago

Indeed it works ! Will try to contribute if I'm stuck again on one.

kugacz commented 2 years ago

It's great to hear :) Thank you for testing! I've released a final version with this fix: 1.0.4.