TypeError: (0 , _vm(...).compileFunction) is not a function
See original GitHub issue🐛 Bug Report
I have a super-simple typescript project I am trying to test. I setup jest following the readme instructions, and am only trying to test 1 typescript class. However, upon running npm t
, I get:
> jest
FAIL src/debugout.spec.ts
● Test suite failed to run
TypeError: (0 , _vm(...).compileFunction) is not a function
at Runtime._execModule (node_modules/jest-runtime/build/index.js:1179:56)
Test Suites: 1 failed, 1 total
To Reproduce
Steps to reproduce the behavior:
- Clone this repo: https://github.com/inorganik/debugout.js/tree/typescript
- Make sure you ave the branch
typescript
checked out - Run
npm i
thennpm t
Expected behavior
Tests should run
Link to repo (highly encouraged)
https://github.com/inorganik/debugout.js
Debug log:
{"context":{"allowJs":false,"logLevel":20,"namespace":"jest-preset","package":"ts-jest","version":"26.1.1"},"message":"creating jest presets not handling JavaScript files","sequence":1,"time":"2020-06-26T16:10:03.257Z"}
envinfo
System:
OS: macOS
Npm packages:
jest: 26.1.0
ts-jest: 26.1.1
typescript: 3.9.5
babel(optional):
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
TypeError: (0 , .....) is not a function - javascript - Stack Overflow
To create a theme you want to use createMuiTheme (https://material-ui.com/customization/theming/) const theme = createMuiTheme({ palette: ...
Read more >VM (executing JavaScript) | Node.js v19.3.0 Documentation
The node:vm module enables compiling and running code within V8 Virtual Machine contexts. The node:vm module is not a security mechanism. Do not...
Read more >VM (executing JavaScript)
The vm module enables compiling and running code within V8 Virtual Machine contexts. The vm module is not a security mechanism.
Read more >qawolf/community - Gitter
TypeError : (0 , _vm(...).compileFunction) is not a function at Runtime._execModule (../node_modules/jest-runtime/build/index.js:1166:56)" it seems that is ...
Read more >How to solve the "is not a function" error in JavaScript
js we use require() to load external modules and files. This can cause, in some cases, an error like this: TypeError: require(...) is...
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
Updating to node v12 fixed it 👍
Oh I am using node 12, maybe you should use node 10.21.0 or higher. I think maybe jest doesn’t support node 10.9