-
Notifications
You must be signed in to change notification settings - Fork 215
Conversation
@andyearnshaw what do you think? |
@skv-headless the source code for this pkg is in src/, not in lib/ or dist/, those are the compiled version of the source for node and browser respectively, and this compilation is done with babel, and we don't want babel to look at the compiled files, that's why those two folders are ignored. |
@skv-headless did you figure out the solution here? |
I've added |
@caridy in RN environment, babel does look at node_modules. Here, package.json is having index.js as the main file which refers to the code in I see two options here: 1) Either we npmignore the babelrc file or 2) we remove the ignore for lib. I think option 1 makes more sense. it would be nice to not add a postinstall in my project for removing the babelrc. And thanks for the awesome lib. 👍 |
Option 1) makes sense, I don't even know why 2) is an option at all. caridy is saying the file is already transformed during build process, why can't babel handle this correctly? From the issue linked above, this looks to be a bug in react-native packager 0.42 and above. |
Went with option 1), thanks everyone for the suggestions. |
try this in React Native. if (!global.Intl) {
global.Intl = require('intl/lib/core')
} But not work in Release Version. Sadly... |
@huhuanming we haven't release a new version yet, you will have to build from source to try this out today. |
thank you. |
@caridy can we get a new release? |
Can we get a new npm version please. |
Yes, please. |
I code a React-Native (v0.44.2) project on node.js (v7.10.0) on an Ubuntu based OS. I've encountered I tried adding the line of Also I tried to remove and to add the line of And also I've tried to add this ignore block to my root
However I couldn't overcome the issue. Is there any solution you know?
|
@efkan after deleting |
@piuccio it works. Thank you a lot. |
My problem described here facebook/react-native#12071.
Babel can't handle
lib/core.js
file iffilename
option passed because babel is using your.babelrc
.var res = babel.transform(file, { code: false, filename: './node_modules/intl/lib/core.js', });
I'm not sure why do you need ignore in
.babelrc