Skip to content

TS: export type * namespace re-export triggers partial extraction (tree-sitter-typescript predates TS 5.0 syntax) #3597

Description

@Dunky13

Summary

An export type * re-export (type-only namespace re-export, e.g. export type * from "./dto";) is rejected by the bundled tree-sitter-typescript grammar, causing the file to be partially extracted with a "syntax errors" warning and no symbols extracted. The file is valid TypeScript — tsc and esbuild accept export type * (added in TypeScript 5.0).

On a Drizzle/Fastify monorepo this hit 20 files, every one a repository barrel whose second line is export type * from "./dto";. export * on the line above parses fine; the failure is specifically the type modifier on the wildcard.

Reproduction — minimal

// with_typestar.ts — triggers "syntax errors" warning, first error at line 1, no symbols extracted
export type * from "./dto";
// without_typestar.ts — parses cleanly
export type { Foo } from "./dto";
// dto.ts
export type Foo = number;

Place all three in an empty directory and run:

graphify update . --force

Result:

warning: 1 file(s) had syntax errors and may be partially extracted: with_typestar.ts (first error at line 1, no symbols extracted)

without_typestar.ts extracts cleanly, confirming the trigger is the type * wildcard, not the type-only re-export syntax in general.

Behaviour compared to #2922 / #3510

Same shape as #2922 (TSX bare &) and #3510 (C# 14 extension members): grammar-level rejection of valid source, exit 0, silent partial extraction, warning points at the recovery line. Different construct — here the bundled tree-sitter-typescript grammar predates export type * (TypeScript 5.0). export type { … } named re-exports parse, so only the namespace-wildcard form is missing.

Environment

  • graphify 0.9.61
  • Language: TypeScript (.ts)
  • Trigger construct: export type * from "…";
  • tsc / esbuild: accept the file cleanly (valid since TS 5.0)

Expected behaviour

export type * from "…"; should parse without a syntax error and extract the file's symbols, matching every other TypeScript toolchain. Barrels using it re-export only, so the lost symbols are pass-throughs indexed at their source, but the noisy warning and dropped file nodes obscure genuine extraction failures.

Activity

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

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