Closed bederuijter closed 6 years ago
Seems weird, probably because of difference in tsconfig ? It should ideally infer the type from the context. I'll try to run it with more node and typesscript versions to make sure of this.
Thanks for reporting!!!
When I have access to my tsconfig, ill post it here, anything else that might help?
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "ClientApp",
"paths": {
"@utilities/*": ["utilities/*"],
"@services": ["services"],
"@models": ["models"],
"@plugins/*": ["plugins/*"],
"@components/*": ["app/components/*"]
},
"lib": ["es6", "dom"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"strictPropertyInitialization": false,
"target": "es6",
"outDir": "./",
"types": ["reflect-metadata", "webpack-env"]
},
"include": [
"./typings/type.d.ts",
"./typings/vue.d.ts",
"./ClientApp/**/*.ts"
],
"exclude": ["bin"]
}
From the frontpage:
For reduced code with decorators, set emitHelpers: true and importHelpers: true
Could the fact that im missing both be a reason that it isn't working as expected?
Could the fact that im missing both be a reason that it isn't working as expected?
Shouldn't be. That just changes how import/export vs require transpilation helper functions work. Your error is at compile stage type-checking itself. I'll look into it.
Fixed in v0.4.2
First of all, I love your library, great work!
Secondly I wanted to try out the MutationAction annotation
I've tried using this test as an example, but it didn't seem to work.
It throws the following exception (from TypeScript)
Through trail and error I did get it working by typing the annotation like
It seems by manually setting the Target Type and Response type it seems to play nice, but since this wasn't mentioned in the documentation, I would assume that there might be something wrong with my setup.
and my class file
Thanks in advance!