Can not compile ts due to error with getter method
See original GitHub issueI’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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@Johannes-Vitt I think it is related to
strict: true
. Do you mind to attempt remove it and let me know if it gets solved? I usually don’t use it because it is… too strict sometimes.Otherwise I’ll check this evening (GMT+1).
@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 😄