Comments (12)
Yes, after doing the yarn eject
it will be there.
OK, I tried again with create-react-app
I did two things.
1 - Added the ignore in package.json jest config
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\](?!react-children-utilities).+\\.(js|jsx|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
2 - Created a babel.config.js in the root folder with the content
module.exports = {
presets: ["react-app"]
};
Those two steps made the tests pass
from react-children-utilities.
This issues still persist, i have run into this problem and spent couple of days already in search of the answer. I have i guess tried all the possible options given on this page and other github pages, no luck :(.
from react-children-utilities.
This issue would happen to any library you include that is published with ES Modules.
Did you try to what's described in jestjs/jest#6229 (comment) ?
In your jest.config.js
try
"transformIgnorePatterns": [
"/node_modules/(?!react-children-utilities)"
]
from react-children-utilities.
This issue persists with PNPM. It's important to know for library authors that ESM modules are still marked as experimentally supported in VM modules, which is required for Jest. I think there's a conception that Node.js can do ESM now and it's actually not there yet.
from react-children-utilities.
The other suggestion was to rename .babelrc
in your project to babel.config.js
from react-children-utilities.
You should try to do both things.
from react-children-utilities.
The other suggestion was to rename
.babelrc
in your project tobabel.config.js
I have tried all of the suggestions in jestjs/jest#6229, none of them work for this particular library. Further, my original project actually uses a babel.config.js
and has never used a .babelrc
and still does not work for this particular library.
from react-children-utilities.
I reproduced the behavior you mentioned but after using babel.config.js
and at the same time adding the transformIgnorePatterns
option in jest.config.js
it worked.
Do you have babel-jest
in your devDependencies
?
from react-children-utilities.
If this issue persists let me know
from react-children-utilities.
I'm also having this problem. My jest and babel configs are in the package.json file.
I've recently made a module that uses rollup and the settings from here:
https://github.com/rollup/rollup-starter-lib/blob/babel/rollup.config.js
and here
https://github.com/rollup/rollup-starter-lib/blob/babel/package.json
Is the issue that this module isn't doing all three of cjs, esm and umd?
from react-children-utilities.
@MaffooBristol I finally stumbled upon writing the transformIgnorePatterns
in the package.json file. Surprisingly I was unable to run the same flag inside my jest.config.json however when i defined it inside my package.json it worked. Be mindful of your regex pattern,
from react-children-utilities.
Using pnpm I had to change the transformIgnorePatterns
to the correct path node_modules/.pnpm
:
transformIgnorePatterns: ['/node_modules/.pnpm/(?!react-children-utilities)']
https://stackoverflow.com/a/76555395/3684315
from react-children-utilities.
Related Issues (20)
- Can't resolve 'react' HOT 1
- deepFind should return the element found, not its root HOT 1
- Issues with "deep children" (aka children within other component) HOT 5
- deepMap, deepFind and deepForEach do not use index & children arguments HOT 5
- onlyText: reduce calls of validate fn HOT 4
- onlyText does not support self closing children
- ESM issue 😬 HOT 21
- Deepmap nested children HOT 3
- Compilation errors when building with webpack 5 HOT 11
- groupByType support UppercaseComponent, not only lowercase like div + span HOT 8
- Problem with husky on npm 7.20.* HOT 2
- getElementName is not exported HOT 1
- deepFilter doesn't match to grandchildren HOT 4
- `deepMap` not iterating over elements with only text as children. HOT 3
- `deepForEachFn` does not accept `children` argument as mentioned in the docs. HOT 2
- ts type HOT 6
- react 18 support request HOT 1
- deepFilter recursion failed on user defined Component HOT 2
- Support named imports by exporting named constants HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-children-utilities.