https://github.com/descriptinc/temporal-polyfill-bug
Demonstration of Typescript bug
https://github.com/descriptinc/temporal-polyfill-bug
Last synced: about 1 year ago
JSON representation
Demonstration of Typescript bug
- Host: GitHub
- URL: https://github.com/descriptinc/temporal-polyfill-bug
- Owner: descriptinc
- Created: 2024-03-21T23:52:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T23:55:25.000Z (about 2 years ago)
- Last Synced: 2024-03-22T00:40:09.626Z (about 2 years ago)
- Language: TypeScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demonstration of CommonJS/ESM interop bug
```shell-session
$ 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.
```