-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Can not compile ts due to error with getter method #96
Comments
Hey there, @Johannes-Vitt, thanks for using passkit-generator! I never met this error you reported me. Also I never used seriously Docker, so I hope I can be helpful. Also, do you mind report Typescript the error code along with the message? So I can do better searches. Until now, I was able to find this proposal: microsoft/TypeScript#43662, but I don't know if that is strictly related. Anyway, what's weird is that Let me know! |
@alexandercerutti Thank you for the quick reply! I also encounter this error when running on my host system instead of docker, so I think it is not related to Docker. I don't have too much experience with typescript, so I am not familiar with all the different settings. Maybe you can spot something that is triggering this error. When I run
You can find my {
"compilerOptions": {
"baseUrl": "./",
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"importHelpers": true,
"module": "commonjs",
"outDir": "dist",
"removeComments": true,
"sourceMap": true,
"strict": true,
"target": "es6",
"moduleResolution": "node",
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/**/*.ts",
"spec/**/*.ts"
, "upload_to_cloud_storage.ts" ],
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false
},
"exclude": [
"spec",
"src/**/*.mock.ts"
]
} |
@Johannes-Vitt I think it is related to Otherwise I'll check this evening (GMT+1). |
@alexandercerutti thank you very much! It is working now. |
@Johannes-Vitt I'll make a review of code with strict mode enabled, but if you want to leverage strict features, I suggest you to enable single flags (at least, for me often it is enough). Closing this meanwhile 😄 |
I'm using node 17.0.1 with typescript version 4.4.4. and I can no longer run my project after I include the import statement for the library.
import { PKPass } from 'passkit-generator';
I went into the node_modules folder of my project and had a look directly into the code of PKPass.d.ts. My IDE showed the following error on line 124 in the getter method for the type:
The return type of a 'get' accessor must be assignable to its 'set' accessor type Type 'undefined' is not assignable to type 'PassTypesProps'.
After having removed
| undefined
from this line, the project was running again. However I am trying to use the library in a docker container where I can not manipulate the node_modules directly, so this is not a fix for me. Is there some typescript setting I'm missing? How else can I avoid this error?The text was updated successfully, but these errors were encountered: