sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

Incompatible with allowSyntheticDefaultImports set to false

Open neelance opened this issue 3 years ago • 2 comments

Your tsconfig.json seems to have allowSyntheticDefaultImports and esModuleInterop set to true. This makes TypeScript throw errors when using the SDK in a project that has decided to not use these legacy support flags any more.

We were able to work around this with very small patches to your code, e.g. use import * as webpack from 'webpack'; instead of import webpack from 'webpack';, so I believe it would be easy and helpful if you would disable these flags in the SDK as well.

neelance avatar Nov 30 '22 22:11 neelance

Seems like this got resolved. Thanks!

neelance avatar Jan 02 '23 10:01 neelance

This is again broken in the @temporalio/testing package:

node_modules/@temporalio/testing/lib/index.d.ts:12:8 - error TS1259: Module '"node:events"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

12 import events from 'node:events';
          ~~~~~~

  node_modules/@types/node/events.d.ts:752:5
    752     export = events;
            ~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

neelance avatar Aug 11 '23 09:08 neelance