GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-imports don’t work in content-mappers without existing import · Issue #64119 · microsoft/TypeScript

Auto-imports don’t work in content-mappers without existing import #64119

New issue
Copy link
New issue
Copy link
Open
Open
Auto-imports don’t work in content-mappers without existing import#64119
Copy link
Assignees
andrewbranch
Labels
Domain: Content MappersNeeds InvestigationThis issue needs a team member to investigate its status.
Milestone
TypeScript 7.1.1 RC

Description

@remcohaszing
Remco Haszing (remcohaszing)
opened on Sep 1, 2026
Issue body actions

🔎 Search Terms

content-mapper

🕗 Version & Regression Information

  • I was unable to test this on prior versions because content mappers aren’t even released yet :)

⏯ Playground Link

n/a

💻 Code

https://github.com/remcohaszing/mdx-content-mapper/tree/auto-import-issue

Specifically, remcohaszing/mdx-content-mapper@04037c2

🙁 Actual behavior

Automatic imports work, if the statement to insert it to is already present. However, if the import statement isn’t present yet, then TypeScript won’t generate the statement.

This works:

Image

This does not:

Image

🙂 Expected behavior

Automatic imports always work.

Additional information about the issue

I tried to make this work by pushing an empty verbatim mapping to the start of the virtual content, like below. The virtual content may start with '// @ts-check\n'. In this case, the mapping is placed after that comment.

let esm = checkMdx ? '// @ts-check\n' : ''
esmMappings.push([
  0,
  0,
  esm.length,
  0,
  /** @satisfies {SpanMapKind.Verbatim} */ (0),
  /** @satisfies {SpanMapFeature.AutoInsert} */ (131_072)
])

Activity

  1. Andrew Branch (andrewbranch)
    self-assigned this
    on Sep 1, 2026
  2. Andrew Branch (andrewbranch)
    added
    Needs InvestigationThis issue needs a team member to investigate its status.
    Domain: Content Mappers
    on Sep 1, 2026
  3. Andrew Branch (andrewbranch)
    added this to the TypeScript 7.1.1 RC milestone on Sep 1, 2026
  4. Daniel Rosenwasser (DanielRosenwasser)
    changed the title [-]Auto-imports don’t work in content-mappers if[/-] [+]Auto-imports don’t work in content-mappers without existing import[/+] on Sep 1, 2026
  5. Leonidas (leonidaz)
    added a commit that references this issue on Oct 2, 2026

    Native TypeScript 7 support for .tsrx through a content mapper (#41) (#…

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

Metadata

Metadata

Assignees

  • @andrewbranch
    Andrew Branch (andrewbranch)

Labels

Domain: Content MappersNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

    Milestone

    • TypeScript 7.1.1 RCNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.