Closed vongohren closed 1 year ago
I can confirm that if I increase my Typescript version, which was 3.3.3, to the latest 3 version, 3.9, this error goes away. But then it should be some dependency notice.
It might be related to these issues: https://github.com/googleapis/nodejs-pubsub/issues/1074 which leads to https://github.com/googleapis/nodejs-pubsub/pull/1079
But upgrading pubsub library, does not solve my other problem: https://github.com/googleapis/nodejs-pubsub/issues/1144
@vongohren it's great that updating your version of TypeScript seemed to solve this problem. I think this is honestly a gap with TypeScript that we have no idea how to fix.
@bcoe another case of older versions of TypeScript giving us trouble. Throwing an idea out there - could we list typescript
as an optionalDependency, and then rely on downstream consumers using --engines-strict
to surface these kinds of errors? Otherwise, I honestly have no idea how we can ever what version of TypeScript our generated d.ts
requires.
@JustinBeckwith I think having it as an optional dependency would be a heavy-handed for our non-TypeScirpt users, as I believe this will attempt an install of the dep (and just not fail if for some reason the install fails).
We could perhaps add a warning that attempts to detect the locally installed TypeScript, and recommends updating if we find an incompatible version.
Closing this out as it appears that this happens with older versions of TypeScript that are now even older (3.3.3 is circa Feb 2019, we're up to 4.8.4 now) since this issue is ~2 years old. :) If this is still causing problems, please open a new issue!
Environment details
@google-cloud/pubsub
version: 2.6.0Steps to reproduce
Extra information
That ts error Leads to this gooogle search: https://www.google.com/search?q=ts1005
I can solve this by using pubsub library version 1.7.3 instead