Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

How to use insecure connection #462

@ottob

Description

@ottob

Im trying to use a local emulator for Cloud Tasks that requires an insecure connection.

Im trying to construct a client like this:
"@google-cloud/tasks" is v2.1.0
"@grpc/grpc-js" is v1.1.6

import { CloudTasksClient } from '@google-cloud/tasks'
import { credentials } from '@grpc/grpc-js'

const client = new CloudTasksClient({
      servicePath: 'localhost',
      port: 8123,
      sslCreds: credentials.createInsecure(),
    })

But get the following error:

error TS2322: Type 'import("/Users/me/myproj/node_modules/@grpc/grpc-js/build/src/channel-credentials").ChannelCredentials' is not assignable to type 'import("/Users/me/myproj/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/channel-credentials").ChannelCredentials'.
  Property 'callCredentials' is protected but type 'ChannelCredentials' is not a class derived from 'ChannelCredentials'.

20       sslCreds: credentials.createInsecure(),
         ~~~~~~~~

Found 1 error.

How can this be done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: cloudtasksIssues related to the googleapis/nodejs-tasks API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions