Skip to content

Typescript - init VertexAI TypeError: VertexAI is not a constructor #3859

@simondpalmer

Description

@simondpalmer

Describe the issue

import { VertexAI } from "@google-cloud/vertexai";
const vertexAI = new VertexAI({project: project, location: location});

Created this as per the Vertex AI SDK but inside a .tsx file instead of a .js file. Error is as follows:
TypeError: google_cloud_vertexai__WEBPACK_IMPORTED_MODULE_3_.VertexAI is not a constructor

Could you provide support for Typescript use?

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.triage meI really want to be triaged.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