Operating System
macOS Sonoma 14.4.1
Browser Version
Chrome/124.0.6367.119
Firebase SDK Version
10.11.1
Firebase SDK Product:
Analytics, Auth, Component, Installations, Logger
Describe your project's tooling
Vue3 app with Vite and Jest
Describe the problem
I'm encountering a TypeScript compilation error involving FirebaseServerAppSettings when "exactOptionalPropertyTypes": true is set in my tsconfig.json. This is the error message:
error TS2430: Interface 'FirebaseServerAppSettings' incorrectly extends interface 'FirebaseAppSettings'.
Types of property 'name' are incompatible.
Type 'undefined' is not assignable to type 'string'.
If I set "exactOptionalPropertyTypes" to false it works.
Here you can see both interfaces:
export declare interface FirebaseAppSettings {
name?: string;
automaticDataCollectionEnabled?: boolean;
}
export declare interface FirebaseServerAppSettings extends FirebaseAppSettings {
authIdToken?: string;
releaseOnDeref?: object;
name?: undefined;
}
Steps and code to reproduce issue
- In your TypeScript project, set "exactOptionalPropertyTypes": true in tsconfig.json.
- Execute
vite build to build the project.