This repository was archived by the owner on Mar 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
"TypeError: Cannot read property 'Reader' of undefined" after upgrading to 2.4.0 #1082
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: Windows 10 (my machine) and Ubuntu 18.04 (GitHub Action runner)
- Node.js version: 12.14
- npm version: 6.14.5
@google-cloud/pubsubversion: 2.4.0- Typescript version: 3.9.7
Steps to reproduce
- Import anything from
@google-cloud/pubsub@2.4.0(e.g.Message), and use it - Run the code
- The following error will occur:
TypeError: Cannot read property 'Reader' of undefined
at ../node_modules/@google-cloud/pubsub/build/protos/protos.js:28:29
at ../node_modules/@google-cloud/pubsub/build/protos/protos.js:22:26
at Object.<anonymous> (../node_modules/@google-cloud/pubsub/build/protos/protos.js:24:3)
at Object.<anonymous> (../node_modules/@google-cloud/pubsub/src/index.ts:156:1)
Minimal reproduction:
import { Message } from '@google-cloud/pubsub';
describe('Test', () => {
it('should work', () => {
expect(Message).toBeDefined();
});
});
I had a look through the diff between 2.3.0 and 2.4.0, but couldn't see anything suspect. I did try downgrading my Typescript version to 3.8.3 to match what this library was compiled with, but the same error occurs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.