@google-cloud/pubsub version: 2.6.0diwala-api: $ tsc && yarn build-ssr
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/fallback.d.ts(119,10): error TS1005: 'from' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/fallback.d.ts(119,13): error TS1005: ';' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/fallback.d.ts(119,29): error TS1005: ';' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/fallback.d.ts(119,34): error TS1005: ';' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/index.d.ts(47,10): error TS1005: 'from' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/index.d.ts(47,13): error TS1005: ';' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/index.d.ts(47,29): error TS1005: ';' expected.
diwala-api: ../../node_modules/@google-cloud/pubsub/node_modules/google-gax/build/src/index.d.ts(47,34): error TS1005: ';' expected.
diwala-api: error Command failed with exit code 1.
diwala-api: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
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
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.
Most helpful comment
@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.