Skip to content

Interface 'FirebaseServerAppSettings' incorrectly extends interface 'FirebaseAppSettings' when "exactOptionalPropertyTypes": true is enabled #8227

@dckz74

Description

@dckz74

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

  1. In your TypeScript project, set "exactOptionalPropertyTypes": true in tsconfig.json.
  2. Execute vite build to build the project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions