https://github.com/avindra/babel-ts-export-type-bug
repro of type erase problem in babel's typescript support
https://github.com/avindra/babel-ts-export-type-bug
babel bug-reproduction typescript
Last synced: 2 months ago
JSON representation
repro of type erase problem in babel's typescript support
- Host: GitHub
- URL: https://github.com/avindra/babel-ts-export-type-bug
- Owner: avindra
- Created: 2020-12-31T19:06:15.000Z (over 5 years ago)
- Default Branch: src
- Last Pushed: 2020-12-31T19:27:41.000Z (over 5 years ago)
- Last Synced: 2025-10-28T23:38:30.604Z (8 months ago)
- Topics: babel, bug-reproduction, typescript
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo contains the minimum needed to demonstrate the type erasure bug seen in Babel's typescript mode.
## Issues
It was seen in [Recharts Issue #2360](https://github.com/recharts/recharts/issues/2360).
* [Babel #12578](https://github.com/babel/babel/issues/12578)
* [Babel #11464](https://github.com/babel/babel/issues/11464)
## Reproduce
Check the checked-in `es6` folder to see what babel is currently emitting, or run `npm run build` / `yarn build` locally.
Expected:
`SomeType` is erased from `es6/index.js`
Actual:
`SomeType` is still referenced in `es6/index.js`
This is a problem for all the JavaScript (non-Typescript) consumers since the type does not exist in the build.
If we check `es6/ModuleA.js`, we can see `SomeType` is erased, so it's at least partly working.