TypeError: classnames is not a function when mapCoverage: true
See original GitHub issue- Issue
Seeing some TypeError when mapCoverage: true.
I managed to reproduce the error with classnames
when enabling mapCoverage, but in my full project even removing mapCoverage doesn’t work.
I have to change all imports from import React = require('react')
to import * as React from 'react'
too.
- Expected behavior
work like old versions
- Link to a minimal repo that reproduces this issue
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
classnames_1.default is not a function when testing with Jest
I just want to see if element has specific class when loaded. classnames is simply js library to return single string of classnames...
Read more >Configuring Jest
Thresholds for globs are applied to all files matching the glob. If the file specified by path is not found, an error is...
Read more >Maps JavaScript API Release Notes - Google Developers
Introduces a language parameter to Geocoder JS API. Maps JS API no longer considers US as a default region in Geocoder if it's...
Read more >TypeError: .map is not a function : r/react - Reddit
I created this React application to practice the fetch API. However, while writing the code to display the data on the browser via...
Read more >@jest/reporters | Yarn - Package Manager
main. Features. Fixes. Chore & Maintenance. Performance. 29.3.1. Fixes. [jest-config] Do not warn about preset in ProjectConfig #13583 ...
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 needed to leave
"allowSyntheticDefaultImports": true
and setting"skipBabel": true
caused new issues (as suggested here)What finally worked for me was to change…
…to
Hope that helps someone else.
When i use this ts config, it still has error of
TypeError: classnames is not a function
,Until I used the following configuration"noImplicitAny": false,
The following is the complete configuration in tsconfig.json{ "compilerOptions": { "target": "es5", "module": "commonjs", "jsx": "react", /*suport react*/ "sourceMap": true, "noImplicitAny": false, "strict": true, "allowSyntheticDefaultImports": true }, "exclude":[ "node_modules" ] }