Support for TypeScript 3.7.2
See original GitHub issueHello!
ts-jest currently does not work with TypeScript 3.7.2. Import statements are not transformed in the transformed code of imports in test files.
src/db/seeds/1-users/users.ts:1
import { ObjectId } from '../../../app/helpers/db';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:703:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:13 (3 by maintainers)
Top Results From Across the Web
3.7.2 - typescript - npm
TypeScript is a language for application scale JavaScript development. Latest version: 4.9.4, last published: 2 days ago.
Read more >Documentation - TypeScript 3.7
Better Support for never -Returning Functions. As part of the work for assertion signatures, TypeScript needed to encode more about where and which...
Read more >TypeScript 3.7.2 for Visual Studio
This is a standalone, power tool release of TypeScript 3.7.2 for Visual Studio. It includes both the TypeScript experience for Visual Studio ...
Read more >TypeScript 3.7.2 - Support for the experimental syntax ...
In my project I am using TS 3.7.2 which should support optional chaining. But when I try to use ...
Read more >Announcing TypeScript 3.7 - Microsoft Developer Blogs
Optional Chaining · Nullish Coalescing · Assertion Functions · Better Support for never -Returning Functions · --declaration and --allowJs · (More) ...
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
For me the problem was that I was using
target: esnext
which tells the compiler that your runtime will be able to handle esnext features, i.e. supports the nullish coalescing and optional chaining operator. I am using node 12 which only supports up until es2018. For people encountering this problem, check what runtime you are using and which features (e.g. operators and functions) are supported (see https://node.green/), and then set your target appropriately.Yes, “target”: “ES2019” resolves this issue!