Skip to content

5.5.0 regression - importHelpers do not work with moduleResolution: bundler #58325

Closed as not planned
@Knagis

Description

@Knagis

🔎 Search Terms

importHelpers
This syntax requires an imported helper but module 'tslib' cannot be found.
TS2354

🕗 Version & Regression Information

fails on 5.5.0-beta

  • This changed between versions 5.4.5 and 5.5.0

reproduces on 5.5.0-dev.20240425
can't be reproduced on playground as it seems to ignore importHelpers

⏯ Playground Link

https://github.com/Knagis/importHelpers-5.5.0

💻 Code

tsconfig.json:

{
    "compilerOptions": {
        "importHelpers": true,
        "target": "es2017",
        "module": "ESNext",
        "moduleResolution": "Bundler"
    },
    "include": [
        "./src/**/*",
    ],
}

src/index.ts

export function foo(args: any) {
    const { bar, ...extraArgs } = args;
    return extraArgs;
}

🙁 Actual behavior

node_modules\.bin\tsc -b
src/index.ts:2:21 - error TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.

2     const { bar, ...extraArgs } = args;
                      ~~~~~~~~~


Found 1 error.

🙂 Expected behavior

Code compiles without errors.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions