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 — __esModule in ts cause breaking change · Issue #51473 · microsoft/TypeScript

__esModule in ts cause breaking change #51473

New issue
Copy link
New issue
Copy link
Closed
#51474
Closed
__esModule in ts cause breaking change#51473
#51474
Copy link

Description

@Jack-Works
Jack Works (Jack-Works)
opened on Nov 10, 2022
Issue body actions

In #51387 the codebase changed to use ESBuild. And now require('typescript') will include __esModule: true and that is a breaking change.

> require("typescript").version
'4.9.2-rc'
> require("typescript").__esModule
undefined
>
> require('typescript').version
'5.0.0-dev.20221109'
> require('typescript').__esModule
true
>

This crashes https://github.com/hipstersmoothie/react-docgen-typescript-plugin

TypeError: Cannot read properties of undefined (reading 'JsxEmit')
    at DocgenPlugin.getOptions (node_modules/@storybook/react-docgen-typescript-plugin/dist/plugin.js:246:39)

It's output code uses tslib.importDefault to import typescript.

const typescript_1 = tslib_1.__importDefault(require("typescript"));
let compilerOptions = {
    jsx: typescript_1.default.JsxEmit.React,
    //   ~~~~~~~~~~~~~~~~~~~~ ts namespace before, undefined after
    module: typescript_1.default.ModuleKind.CommonJS,
    target: typescript_1.default.ScriptTarget.Latest,
};

Activity

  1. jakebailey commented on Nov 10, 2022

    @jakebailey
    Jake Bailey (jakebailey)
    on Nov 10, 2022
    Member
    More actions

    Thanks for testing this so early. This is unfortunate.

    Can you try with "typescript": "npm:@typescript-deploys/[email protected]" and see if the issue goes away? (from #51474)

  2. Jack-Works commented on Nov 10, 2022

    @Jack-Works
    Jack Works (Jack-Works)
    on Nov 10, 2022
    ContributorAuthor
    More actions

    yes, this fixes the problem

  3. Jake Bailey (jakebailey)
    closed this as completedin #51474on Nov 10, 2022
  4. microsoft
    locked as resolved and limited conversation to collaborators on Oct 22, 2025
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

      You are visitor 01402503 — 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.