这是indexloc提供的服务,不要输入任何密码
Skip to content

Error: Type '"origin" | undefined' is not assignable to type '"origin"' during Build. #1202

@us24man

Description

@us24man

While building my Next JS project using "npm run build" I get this error.

Type error: Type '"origin" | undefined' is not assignable to type '"origin"'.
  Type 'undefined' is not assignable to type '"origin"'.
./node_modules/@googlemaps/js-api-loader/src/index.ts:301:5

  299 |   }: LoaderOptions) {
  300 |     this.apiKey = apiKey;
> 301 |     this.authReferrerPolicy = authReferrerPolicy;
      |     ^
  302 |     this.channel = channel;
  303 |     this.client = client;
  304 |     this.id = id || DEFAULT_ID; // Do not allow empty string

This is really annoying as i am unable to deploy the app to Vercel because of this.

Steps to reproduce:

  1. Create a Next JS app
  2. Install the latest version of this package
  3. Build

package version 3.4.0
Next JS version 14.2.3
Typescript version ^5

Metadata

Metadata

Assignees

No one assigned

    Labels

    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