TypeError: channelCredentials._equals is not a function
See original GitHub issueThis issue occurs on versions 1.1.2 and later.
When attempting to publish a message to the emulator, I’m getting the following error:
TypeError: channelCredentials._equals is not a function
Function to re-create error:
const pub = async (topicName, data) => {
const options = {
keyFilename,
projectId
};
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
options.apiEndpoint = 'emulator:8085';
}
const pubsub = new PubSub(options);
const stringifiedData = JSON.stringify(data);
const dataBuffer = await Buffer.from(stringifiedData);
const topic = `projects/${projectId}/topics/${topicName}`;
return pubsub
.topic(topic)
.publish(dataBuffer)
.then((response) => {
logger.info('Message published.', response);
return {
success: true
};
})
.catch((error) => {
logger.error('Failed to publish topic', error);
return {
success: false
};
});
};
Dockerfile of emulator:
FROM google/cloud-sdk:alpine
LABEL maintainer="LADbible Group"
RUN apk --update add openjdk7-jre
RUN gcloud components install --quiet beta pubsub-emulator
RUN gcloud components update
RUN mkdir -p /var/pubsub
VOLUME /var/pubsub
EXPOSE 8085
CMD [ "gcloud", "beta", "emulators", "pubsub", "start", "--data-dir=/var/pubsub", "--host-port=0.0.0.0:8085", "--log-http", "--verbosity=debug", "--user-output-enabled" ]
Environment details
- OS: alpine
- Node.js version: 10.15.0
- npm version: 6.5.0
@google-cloud/pubsub
version: 1.1.2+
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
TypeError: $.equals is not a function - Stack Overflow
Ok, first things first. When something goes wrong, and you decide to debug it with console.log, NEVER use + . Yes, I know...
Read more >node_modules/@grpc/grpc-js/src/channel-credentials.ts
Check whether two channel credentials objects are equal. Two secure. 112. * credentials are equal if they were constructed with the same ...
Read more >How to Uncaught TypeError: x is not a function - YouTube
TypeError : "x" is not a functionThe JavaScript exception "is not a function " occurs when there was an attempt to call a...
Read more >2 Server Error Message Reference - MySQL :: Developer Zone
Message: %s is not allowed in stored function or trigger ... Message: Binary operands of bitwise operators must be of equal length.
Read more >How to use ChannelCredentials in grpc - Javascript - Tabnine
ChannelCredentials (Showing top 4 results out of 315). Tabnine vs. GitHub Copilot ... function getGrpcClientStream () { const client = new helloPkg.
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
Found the same when attempting to connect to the emulator. Latest version of both the emulator and this library.
@feywind If the issue isn’t resolved with the new version of grpc-js (and it’s still an issue with the emulator) let’s kick it to @kamalaboulhosn for guidance on ownership.