Skip to content

Should not allow import.defer?.('x') #63679

Description

@fisker

🔎 Search Terms

"import defer"

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about 6.0.3_____
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play/?moduleResolution=99&target=99&ssl=3&ssc=40&pln=2&pc=1#code/JYWwDg9gTgLgBPAZlCI4HIYE8wFMDOAxlMGDOgNwBQVhEAdvvGHALxyiSwB0AJrolxQA-NwAUmHAWKlyASgpA

💻 Code

import.defer?.('x');

🙁 Actual behavior

No errors.

🙂 Expected behavior

Should not allow it as an optional call.

Additional information about the issue

Parsers like Oxc, Yuku, SWC, Babel all reject it. I didn't read the spec, but unless they are wrong.

Activity

  1. nightcityblade commented on Jul 29, 2026

    @nightcityblade

    Hi, I'd like to work on this. I'll submit a PR shortly.

  2. nightcityblade commented on Jul 29, 2026

    @nightcityblade

    I need to step back from this one after reviewing the repository's maintenance-mode contribution guidance, so this issue is available for others.

  3. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one — I'll follow up with a PR. (claiming via Stella (@LeonxLJX))

  4. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    Hi! I'd like to add a diagnostic for import.defer?.('x'). Plan: reproduce, add the check in the parser/checker, add tests. May I be assigned?

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

    BugA bug in TypeScriptDomain: ParserThe parser didn't handle the syntax correctlyHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions