Skip to content

TypeScript error: PrivateService missing from client module #1532

@Pattkopp

Description

@Pattkopp

Issue Description

There's a TypeScript error in the project related to the PrivateService which appears to be missing from the client module:

TS2305: Module '"../../src/client"' has no exported member 'PrivateService'.

Location

  • File: /frontend/tests/utils/privateApi.ts
  • Line: import { OpenAPI, PrivateService } from "../../src/client"

Hypothesis (might be incorrect)

Based on the comment in privateApi.ts:

// Note: the `PrivateService` is only available when generating the client
// for local environments

It appears that PrivateService might be conditionally generated only in local development environments. The client generation process seems to be controlled by:

  1. scripts/generate-client.sh
  2. The generate-client script in frontend/package.json which uses openapi-ts

Possible solutions to investigate:

  1. Generate the client with the correct environment variable to include PrivateService
  2. Modify privateApi.ts to use existing services like UsersService instead
  3. Add conditional logic to check if PrivateService exists before using it

Disclaimer

This is just a hypothesis based on code analysis and may be incorrect. Further investigation is needed to confirm the actual cause and find the proper solution.

Next steps

  • Check how the client is generated in different environments
  • Review API documentation to understand what PrivateService was intended to do
  • Consider the appropriate fix based on project requirements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions