You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First I want to say that I am very glad you made this compile time DI library for TS! It does not have many features, it just contains what is necessary, that is perfect :)
I am trying to make the di-compiler work with Parcel (I use Parcel to set up "easily" a React project with di-compiler after that). Almost everything is working (it correctly generates the constructors data), however for some reason the bindings are not generated.
Everything works fine if I write:
I get a Uncaught ReferenceError: DIContainer could not get service: No arguments were given! for the registerSingleton calls and a Uncaught ReferenceError: DIContainer could not get service: No options was given! for the get call.
Do you have any idea of what is wrong or what is missing?
To make the integration work, I use parcel-plugin-ttypescript that enables me to specify some TS transformers in the tsconfig.json file. After that, I needed to make a small adapter between this parcel plugin and di-compiler:
import { di } from "@wessberg/di-compiler";
import * as ts from 'typescript';
export default function(program: ts.Program) {
return di({ program });
}
Hello,
First I want to say that I am very glad you made this compile time DI library for TS! It does not have many features, it just contains what is necessary, that is perfect :)
I am trying to make the di-compiler work with Parcel (I use Parcel to set up "easily" a React project with di-compiler after that). Almost everything is working (it correctly generates the constructors data), however for some reason the bindings are not generated.
Everything works fine if I write:
However, if I try to use the standard syntax:
I get a
Uncaught ReferenceError: DIContainer could not get service: No arguments were given!
for theregisterSingleton
calls and aUncaught ReferenceError: DIContainer could not get service: No options was given!
for theget
call.Do you have any idea of what is wrong or what is missing?
To make the integration work, I use
parcel-plugin-ttypescript
that enables me to specify some TS transformers in thetsconfig.json
file. After that, I needed to make a small adapter between this parcel plugin and di-compiler:I created a repository with a minimal project to reproduce the issue: https://github.com/amanteaux/poc-parcel-di-compiler
The two ways of writing the bindings are in
src/index.ts
.Thank you for any help/hints to make the integration works!
Cheers
The text was updated successfully, but these errors were encountered: