-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When requiring outside library, transform process hangs #2949
Comments
I think we should add a For now, can you please debug like this? Edit: your_app_folder/node_modules/react-native/packager/transformer.js Add For me this prints something like:
This way you'll see on which file the transform step got stuck. |
cc @martinbigio |
@mkonicek thanks for replying quickly. Here is what I got with the console.log function in there:
Any ideas on what to do? |
@mkonicek that's a great idea! |
The same issue is on our side with https://www.npmjs.com/package/quickblox I guess the main issue is with 'Unable to resolve module' logs Do you have any ideas? |
Same issue with https://www.npmjs.com/package/request |
Same issue on my end. Looks like it's hanging with Cheerio. Note: This used to work in RN 0.8.0, and afaik in RN 0.11.0. I'm not sure what happened if I accidentally upgraded babel or something cleared its cache.
|
I figured out the culprit. Cheerio was requiring package.json to get the version. Babel was either unable to, or never told to transform package.json. I figured this out by adding a
This listed the dependencies and I saw that package.json was required. I then found where in the code it was being required, removed it and was able to build my app successfully. |
Thanks for all the examples and sorry for the delay - I just returned from vacation. Passing this to Sebastian McKenzie who works on Babel to take a look. |
I don't think it's Babel. I don't think the packager supports loading JSON files. You can set the environment variable |
@stan229 I tried that but I wasn't able to figure out how to find where the package.json file was required to remove that. Any tips there? |
@criticerz try adding that |
We do support JSON file loading. I'll look into what's going on with cheerio. We should stop trying to transform JS files in node_modules (we have to do this with react and react-native but nothing else). Also, recently added: You can also see debug logs in the packager using EDIT: It should be |
👍 Thanks for looking @amasad! |
I had the same problem with /*
Export the version
*/
exports.version = require('./package').version; I've just added |
Found the problem -- submitting a diff for this. |
Will be cutting 0.13-rc soon which will contain this fix. |
Summary: @public Dead-lock trying to read package.json because it's both a "module" and a "package". in `Module.getName` it uses the cache key "name" and tries to call `Package.getName` which uses the same cache key and we end up returning the same promise that we're trying to resolve resulting in a dead-lock. This changes the cache keys for the packages that adds a prefix "package-". Reviewed By: @vjeux Differential Revision: D2506979
Summary: @public Dead-lock trying to read package.json because it's both a "module" and a "package". in `Module.getName` it uses the cache key "name" and tries to call `Package.getName` which uses the same cache key and we end up returning the same promise that we're trying to resolve resulting in a dead-lock. This changes the cache keys for the packages that adds a prefix "package-". Reviewed By: @vjeux Differential Revision: D2506979
This is my index.io.js file:
and my package.json file:
Unfortunately, when I build the app the following happens in the console:
And it just hangs there forever. Notice that if I take out the
var LayerAPI = require('layer-api');
line it works fine.Any ideas why that package is causing trouble? I tried another external package and the same thing happened. I made sure to install them using
npm install layer-api --save
I'm using React-Native v0.11, Node v4.0.0 & npm v2.14.2.
The text was updated successfully, but these errors were encountered: