Cannot build v0.28.1
See original GitHub issue- OS: Ubuntu
- Node.js version: 10.15.1
- npm version: 6.4.1
@google-cloud/pubsub
version: 0.28.1
Steps to reproduce
In a new project:
npm install typescript @google-cloud/pubsub
- Create a file
src/index.ts
with content:
import { PubSub } from "@google-cloud/pubsub";
console.log("Hello world!");
npx tsc --init
- Set rootDir and outDir in tsconfig.json.
- run
npx tsc
and the console output should give you a typescript error:
~/code/labs/pub-sub (master #)$ npx tsc
node_modules/google-gax/build/src/streaming.d.ts:47:42 - error TS2507: Type '{ default: DuplexifyConstructor; obj(writable?: Writable | undefined, readable?: Readable | undefined, streamOptions?: DuplexOptions | undefined): Duplexify; }' is not a constructor function type.
47 export declare class StreamProxy extends Duplexify {
~~~~~~~~~
Found 1 error.
I tried to downgrade the pubsub version a bit but it didn’t solve it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Redwood v0.28 (is amazing!) - Releases and Upgrade Guides
This release contains recommended code modifications, which are required to use new features such as the Logger. See the “How to Upgrade” ...
Read more >Image Layer Details - snyk/driftctl:v0.28.1 | Docker Hub
v0.28.1. logo. snyk/driftctl:v0.28.1. Log4Shell CVE not detected. Digest:sha256:56b3e423d8335764432a6dddf7e318a09614a567f5e80272827814b2a346c7b8. OS/ARCH.
Read more >Go 1.19 just dropped - Development - Syncthing Forum
The current main fails to build on Go 1.19 in my tests with the following error. # github.com/lucas-clemente/quic-go/internal/qtls C:\.
Read more >Release Notes — lf-releng-global-jjb v0.40.4.dev0+b7c2eb9 ...
Support for the Throttle Plugin is added to JJB jobs so static build servers can restrict the number of concurrent JJB jobs ran...
Read more >No cached version... available for offline mode. - Stack Overflow
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'MyApplication2'. > Could not resolve all ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that it builds with
const { PubSub } = require("@google-cloud/pubsub");
.I haven’t run any code yet to try it out, but hopefully this unblocks us from using the latest version.
Well done with the speedy work here! 🥇
From my point of view, you can close the issue unless you want to keep it open to solve the root cause.
typescript
3.3.3333
Same error as @marcusnielsen, in
gax-nodejs/src/streaming.ts
they are doing:Edit: removing this is not ideal, causes errors importing other modules.
Making this change in mytsconfig.json
eliminated the build error:esModuleInterop
:Seems
import * as
is discouraged:https://github.com/Microsoft/TypeScript/pull/19675
Edit
Try this instead of removing
esModuleInterop
to isolate fix only to this library:const PubSub = require('@google-cloud/pubsub').PubSub