Cannot read property 'createTransformer' of undefined
See original GitHub issue🐛 Bug Report
After upgrading from ts-jest
version 26.5.6
to version 27.0.3
on nom run test
I’m getting the below error:
ERROR: Cannot read property 'createTransformer' of undefined
STACK: TypeError: Cannot read property 'createTransformer' of undefined
at ConfigSet._setupConfigSet
To Reproduce
Upgrading from ts-jest
version 26.5.6
to version 27.0.3
Expected behavior
To be able to run tests.
Debug log:
# content of ts-jest.log :
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'run',
0 verbose cli 'test'
0 verbose cli ]
1 info using npm@7.5.1
2 info using node@v15.8.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:C:\Users\user\Development\project\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\user\.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\user\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 7ms
19 verbose npm-session 9b21760416926f29
20 timing npm:load Completed in 14ms
21 timing command:run-script Completed in 79278ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:378:20)
22 verbose stack at maybeClose (node:internal/child_process:1067:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
23 verbose pkgid specs@1.0.0
24 verbose cwd C:\Users\user\Development\project
25 verbose Windows_NT 10.0.19042
26 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
27 verbose node v15.8.0
28 verbose npm v7.5.1
29 error code 1
30 error path C:\Users\user\Development\project
31 error command failed
32 error command C:\windows\system32\cmd.exe /d /s /c jest --config jest.config.js
33 verbose exit 1
envinfo
System:
OS: Windows
Node version: `15.0.0`
Npm packages:
jest: 27.0.4
ts-jest: 27.0.3
typescript: 4.3.2
babel: 6.23.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top Results From Across the Web
react native - Cannot read properties of undefined (reading ...
I found this problem trying to run a test using Jest in a React Native project: TypeError: Cannot read properties of undefined (reading ......
Read more >Code Transformation - Jest
A transformer is a module that provides a method for transforming source files. For example, if you wanted to be able to use...
Read more >cannot read property 'pathname' of undefined jest - You.com
I am very new to write test cases, i tried to write test cases for my dashboard page and i am getting Cannot...
Read more >babel-jest - npm
Jest plugin to use babel for transformation.. Latest version: 29.3.1, last published: 2 months ago. Start using babel-jest in your project ...
Read more >JEST: "TypeError: Cannot read property 'platform' of undefined"
... required fields are filled (73 ms) console.error [Vue warn]: Error in render: "TypeError: Cannot read property 'platform' of undefined" ...
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
I suspect the problem might come from React itself.
I see you are using babel-jest too, make sure it is also v27
remove
node_modules
, reinstall deps and clear Jest cache should help.