Module Not Found: @foundry/functions-api in TypeScript v2 Repository

Issue Description:
I am following the “Building Your First Ontology Function” speedrun. In a new TypeScript v2 repository, the environment is failing to resolve @foundry/functions-api and @foundry/ontology-api.

Error Message:
Cannot find module '@foundry/functions-api' or its corresponding type declarations.

Details & Context:

  • Environment: Code Repositories, TypeScript v2.

  • Steps Taken:

    • Import Ontology resources (Clinic, Financial) via the Resource Imports side panel.

    • Restarted Code Assist and refreshed the browser multiple times.

    • Verified functions.json has enableResourceGeneration: true.

  • Observations: Even after adding resources, the “Generating Types” progress bar completes, but the red squiggles remain on the @foundry imports. The environment appears unable to “materialize” the virtual packages required for the logic.

Desired Outcome:
Seeking guidance on forcing the TypeScript v2 language server to correctly index these virtual modules or identifying if there is a known compatibility issue with specific versions of the Functions API in v2.


Hi ConnorOrzen,

Thanks for sharing this issue here. This learn course requires the use of Typescript Functions V1 instead of V2, this will be why you are seeing the following errors here.

I would suggest restarting the course and choosing Typescript Functions V1 as per the attached screenshot.

If you are still unable to resolve the error then I would suggest reaching out to training-feedback@palantir.com

Kind regards, Luke

Thank you so much for the solution! That fixed the immediate environment issue.

Out of curiosity, I was specifically trying to replicate the ‘Building Your First Ontology Function’ logic within a TypeScript v2 repository to see how the speedrun holds up in a more current environment. Since the platform defaults new repositories to this version now, I wanted to figure out the bridge between the tutorial’s legacy syntax and the modern OSDK requirements so I could help others who encounter the same version gap.

Thanks again!