Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4293

Typescript 4.8 fails to compile driver -- fixed in official release

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.10.0
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed

      Failure: https://evergreen.mongodb.com/task_log_raw/mongo_node_driver_next_lint_run_typescript_next_6cae4b4f9b37ca760377b3ef08421d12d88d4617_22_06_02_21_30_52/0?type=T#L167

       Sample of errors:

      src/admin.ts(82,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'.
      src/admin.ts(106,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'.
      src/admin.ts(125,41): error TS2322: Type 'Callback<Document> | (CommandOperationOptions & Function)' is not assignable to type 'Callback<Document> | undefined'.
      

       
      Typescript's next version appears to add an intersection with Function instead of narrowing our function argument overloading to Callback when we use typeof x === 'function'.

      Update: This ticket was filed when TS 4.8 was in beta, this issue was resolved before the official release.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: