Closed magus closed 7 years ago
Hello @magus. That's strange indeed. The library doesn't need dependencies (except from your own Baobab and react, obviously) to be used and the released files are transpiled. Can you try to install 2.0.0-rc2
and tell me whether the problem persists please?
It persists with React Native 0.25.1.
Does React Native installs relies on dev dependencies even if this is not needed?
It's hard to say. It builds dependency graph based on node_modules require calls before running and it's possible that it parses package.json and interprets this: https://github.com/Yomguithereal/baobab-react/blob/cfa1ec5796079fdf2f5adad887fe1259244c1d01/package.json#L52 . It's only a guess though.
That's not impossible indeed but this would be quite strange for him to do so. Can you point me toward a library written in ES6 and used with react-native somewhere so I can try to find a solution?
This popped up for me again...moment is ES6 but not using babel.
After installing babel-preset-es2015 I'm seeing a new error...
TransformError: /node_modules/baobab-react/dist-modules/mixins.js: [BABEL] /node_modules/baobab-react/dist-modules/mixins.js: Unkown option: /node_modules/react/react.js.Children
Had to install all the babel-preset dependencies to get things to build properly. Not sure I fully understand why or have the bandwidth to investigate.
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
I am a bit lost here and don't know how I can help you further. Is your project open source somehow so I can try to reproduce the issue on my end?
It would be enough to create an empty react-native project and use baobab-react inside. It crashes during library require call.
The issue seems to be related to react-native. See this issue for instance, or this one also. It would mean I need to put Babel configuration out of the package.json and ensure the config is not in the released package but this is quite annoying. Let me check the evolution of the problem on react-native's side.
Looks like there is a dependency on es2015 preset in the latest release from npm?
Seeing an error in
baobab-react/mixins.js
Couldn't find preset "es2015" relative to directory...