Skip to content

fix: import AstPath as type-only from prettier - #51

Merged
vectronic merged 1 commit into
mainfrom
dev
Jul 20, 2026
Merged

fix: import AstPath as type-only from prettier#51
vectronic merged 1 commit into
mainfrom
dev

Conversation

@vectronic

Copy link
Copy Markdown
Collaborator

Summary

  • AstPath was imported as a runtime value in 13 prettier printer files, but is only ever used as a TypeScript type (generic annotations, as AstPath<...> casts).
  • prettier's standalone.mjs build does not export AstPath at runtime, so consumers bundling this package (e.g. Bun's bundler) fail with:
    error: No matching export in "prettier/standalone.mjs" for import "AstPath"
  • Changed each affected import to type AstPath (or added type inline in mixed imports) so no runtime import is emitted.

Test plan

  • tsc -p tsconfig.build.json passes with no errors
  • Downstream consumer (mpeg-sdl-editor) bun run build succeeds against this branch

AstPath is only used as a TypeScript type in these files, but was
imported as a runtime value. prettier's standalone.mjs build does not
export AstPath at runtime, which breaks bundlers that consume this
package (e.g. Bun) with "No matching export in standalone.mjs for
import AstPath".
@vectronic
vectronic merged commit 393b626 into main Jul 20, 2026
5 checks passed
@vectronic
vectronic deleted the dev branch July 20, 2026 10:14
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.

1 participant