GoogleCloudPlatform / GoogleCloudPlatform/nodejs-docs-samples

Typescript - init VertexAI TypeError: VertexAI is not a constructor

Open
#3,859 0 comments 0 reactions 0 assignees View on GitHub
priority: p2 samples triage me type: bug
Dominant language
JavaScript
Stars
3k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
44

Description

## 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.