TypeScript 3.8 "import type" is not supported
See original GitHub issueDo you want to request a feature or report a bug?
Feature request.
What is the current behavior?
Import type are not recognized by metro’s babel version (it uses 7.8.4 instead of 7.9 which supports them).
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install
and yarn test
.
What is the expected behavior?
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Using npm to install metro-react-native-babel-preset (version: 0.59.0).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >Do I need to use the "import type" feature of TypeScript 3.8 if ...
Long answer: As TypeScript 3.8 release notes say: import type only imports declarations to be used for type annotations and declarations.
Read more >Support TypeScript 3.8 type-only imports/exports in resolve ...
@Anton Lobov I want to clarify. This will involve an implementation to allow auto-import using type-only syntax for TS 3.8+? I saw the...
Read more >Leveraging Type-Only imports and exports with TypeScript 3.8
This new feature of TypeScript added the possibility to import an element only as a type, precisely for cases where a type is...
Read more >type-only imports — A new TypeScript feature that benefits ...
Example 1 — Ambiguous re-export · Babel removes everything from our types module because it only contained types, which have no use in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@WhippetsAintDogs thx for your comment:
I was trying to find out on the repo where metro declares this specific babel version, but it seems that it doesn’t.
It uses
^7.0.0
, which probably means that any 7.x.y works. So after updating my ownpackage.json
with:It worked without any problems… till now 🤔
@Grohden, you’re right. Regenerating metro’s part in my package-lock fixed it.
Thanks !