googlemaps / googlemaps/google-maps-services-js

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

Open
#1,202 7 comments 3 reactions 0 assignees View on GitHub
triage me type: bug
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

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

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.