You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running across this bug when trying to import this package into a Typescript project configured to emit CommonJS modules:
$ pnpm run typecheck
> temporal-polyfill-bug@1.0.0 typecheck /src/temporal-polyfill-bug
> tsc --build tsconfig.json
index.ts:1:26 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("temporal-polyfill")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `"type": "module"` to '/src/temporal-polyfill-bug/package.json'.
1 import { Temporal } from 'temporal-polyfill';
~~~~~~~~~~~~~~~~~~~
Found 1 error.
ELIFECYCLE Command failed with exit code 1.
I've reproduced the above bug using a minimal example by cloning, running pnpm i, and then pnpm run typecheck.
I am running across this bug when trying to import this package into a Typescript project configured to emit CommonJS modules:
I've reproduced the above bug using a minimal example by cloning, running
pnpm i
, and thenpnpm run typecheck
.I believe a fix is relatively straightforward based on microsoft/TypeScript#53045.
The text was updated successfully, but these errors were encountered: