-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Non-optional fields causing TypeScript errors #749
Comments
There is a table of required properties of the different JSON structures here. If you generated the respective JSON descriptor somehow, there might be something wrong in generation instead. Alternatively, the issue could be more general in that the object does not match any valid type. For instance, if |
Right, but it's not required on every single thing, right? You can treat it not being there as null. If I just ignore the typing error protobufjs works correctly anyway right now. |
Yeah, without a marker, addJSON falls back to treat the object as a namespace. Inner namespaces aren't really intended, though, but could be added somewhere around here. Issue here is that |
I nest namespaces in my code, quite a bit actually. It seems to work just fine! Is this just a typings issue, or does something need to be changed in ProtobufJS to support that pattern? Assuming the fallback is actually working as intended and I'm not abusing some kind of bug. |
More of a typings issue because of empty objects.
|
Currently trying to fix this, but as soon as I add a sixth type to
my VSCode hangs with 100% cpu. That's new. Lots of recursion if I had to guess. |
My The issue is with only one of the checkers - the "unused variable" checker. But you're not even using tslint, I think. Your vscode might be using it internally. You could try turning off that checker in a little tslint.json file and see if it fixes it. |
Actually had a tslint plugin installed but the issue remains after uninstalling it. That's amazing... |
eslint? Wait, no, you had to be using tslint, if the issue started happening after you changed the typings. I would try dropping a tslint.json in the root of your repo, here's mine: [removed] There are some Angular2 rules in there that you'll get errors about but you can just delete those lines. The most important part is to turn off the unused variable analysis. |
Here's the non-angular2 one with the unused variable checker disabled:
|
https://github.com/Microsoft/vscode-textmate |
Well, I introduced a new otherwise useless type vscode issue: microsoft/vscode#23958 |
Should be working with 6.7.3. Feel free to reopen if it's not! |
protobuf.js version: 6.7.1
I'm passing the output of pbjs json conversion to loadJson, this works fine, but there's a new typing error in the latest update:
The issue is that the "methods" field is not optional. Could you please set that field to optional in the typings?
Thanks!
The text was updated successfully, but these errors were encountered: