Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc @import of "tslib" fails under --moduleResolution bundler #60007

Open
andrewbranch opened this issue Sep 19, 2024 · 0 comments · May be fixed by #60011
Open

JSDoc @import of "tslib" fails under --moduleResolution bundler #60007

andrewbranch opened this issue Sep 19, 2024 · 0 comments · May be fixed by #60011
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@andrewbranch
Copy link
Member

// @noEmit: true
// @checkJs: true
// @allowJs: true
// @module: preserve

// @Filename: node_modules/tslib/package.json
{
    "name": "tslib",
    "exports": {
        ".": {
            "module": {
                "types": "./modules/index.d.ts",
                "default": "./tslib.es6.mjs"
            },
            "import": {
                "node": "./modules/index.js",
                "default": {
                    "types": "./modules/index.d.ts",
                    "default": "./tslib.es6.mjs"
                }
            },
            "default": "./tslib.js"
        },
        "./*": "./*",
        "./": "./"
    }
}

// @Filename: node_modules/tslib/modules/index.d.ts
export {};

// @Filename: node_modules/tslib/tslib.d.ts
export {};

// @Filename: test.js
/** @import * as tslib from "tslib" */
/** @type {typeof tslib} T */

Expected behavior

Import resolves

Actual behavior

Cannot find module 'tslib' or its corresponding type declarations.ts(2307)

Even though quick info also shows

module "/Users/andrew/Developer/microsoft/eg/js/node_modules/tslib/modules/index"
@andrewbranch andrewbranch self-assigned this Sep 19, 2024
@andrewbranch andrewbranch added this to the TypeScript 5.7.0 milestone Sep 19, 2024
@andrewbranch andrewbranch added the Bug A bug in TypeScript label Sep 19, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants