Skip to content

fix: bundle TypeScript lib files for TypeScript→JSON Schema API#433

Open
KushalLukhi wants to merge 1 commit intoritz078:masterfrom
KushalLukhi:fix/421-include-typescript-lib-in-vercel
Open

fix: bundle TypeScript lib files for TypeScript→JSON Schema API#433
KushalLukhi wants to merge 1 commit intoritz078:masterfrom
KushalLukhi:fix/421-include-typescript-lib-in-vercel

Conversation

@KushalLukhi
Copy link

@KushalLukhi KushalLukhi commented Mar 20, 2026

Summary

Fixes the TypeScript to JSON Schema endpoint failing with HTTP 500 in production due to missing TypeScript default library files (lib.d.ts).

Closes #421

Problem

The API route (/api/typescript-to-json-schema) uses ts-json-schema-generator, which depends on TypeScript standard library declaration files at runtime.

In the deployed Vercel function, these files were not traced into the serverless bundle, resulting in errors like:

  • Cannot find global type 'Array'
  • File '/var/task/node_modules/typescript/lib/lib.d.ts' not found.

Change

Add an explicit Vercel function include for this route:

"functions": {
  "api/typescript-to-json-schema.ts": {
    "includeFiles": "node_modules/typescript/lib/**"
  }
}

This ensures the required TypeScript lib declaration files are present at runtime for schema generation.

Notes

  • No behavior change for local development.
  • This is a deploy/runtime packaging fix for serverless environments.

@vercel
Copy link

vercel bot commented Mar 20, 2026

@KushalLukhi is attempting to deploy a commit to the ritesh-oss Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: TypeScript to JSON schema is broken

1 participant