Skip to content

Exported namespace class suppresses TS1308 for await in computed member names #63712

Closed

Description

@mohsen1

🔎 Search Terms

await, namespace, computed property, computed member, TS1308, export class, top-level await

🕗 Version & Regression Information

This occurs in every version tested: 7.0.2 and 7.1.0-dev.20260802.1 (nightly). I reviewed the FAQ and searched open and closed issues.

💻 Code

declare const x: string;

namespace N {
  class A { [await x]() {} }        // TS1308
  export class B { [await x]() {} } // no error
}

export {};

🙁 Actual behavior

export suppresses TS1308. The emitted await is inside the namespace's synchronous IIFE, producing invalid JavaScript.

🙂 Expected behavior

Both computed names report TS1308.

Activity

  1. KumJungMin commented on Aug 11, 2026

    @KumJungMin

    Hi! I'd be interested in working on this issue if no one is already working on it :)

  2. added
    Domain: Parser
    on Aug 11, 2026
  3. RyanCavanaugh commented on Sep 19, 2026

    @RyanCavanaugh
    Member

    This is fixed in TypeScript 7.1.0-dev.20260811.1 and current native builds. Both class A { [await x]() {} } and export class B { [await x]() {} } inside the namespace now report TS1308.

    The change was made by microsoft/typescript-go#4823, which preserves the enclosing await context for exported classes in nested containers.

  4. added
    Fixed
    Needs Human Review
    on Sep 19, 2026
  5. removed
    Needs Human Review
    on Sep 23, 2026
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

    BugDomain: ParserFixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions