Skip to content
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

Packager hangs indefinitely on require('redux') in v0.16.0 #4674

Closed
anshul opened this issue Dec 9, 2015 · 17 comments
Closed

Packager hangs indefinitely on require('redux') in v0.16.0 #4674

anshul opened this issue Dec 9, 2015 · 17 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@anshul
Copy link

anshul commented Dec 9, 2015

[6:57:52 PM] <START> transform transforming [======================================= ] 97% 383/395

and it stays hung there for hours...

@facebook-github-bot
Copy link
Contributor

Hey anshul, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If this is a feature request or a bug that you would like to be fixed by the team, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • We welcome clear issues and PRs that are ready for in-depth discussion; thank you for your contributions!

@anshul anshul changed the title Packager hangs indefinitely on require('redux') Packager hangs indefinitely on require('redux') in v0.16.0 Dec 9, 2015
@sunify
Copy link

sunify commented Dec 9, 2015

I have error with redux when i try make a bundle:
uncaught error Error: ReferenceError: [BABEL] /Users/sunify/react-native/CoachingApp/node_modules/redux/lib/index.js: Unknown option: /Users/sunify/react-native/CoachingApp/node_modules/redux/.babelrc.stage

@ide
Copy link
Contributor

ide commented Dec 9, 2015

Redux and React Native 0.16 are incompatible until Babel 6's babelrc resolver matches Babel 5's.

@holyxiaoxin
Copy link
Contributor

I believe this is the issue. Any patch to this for the moment? Or we have to wait for the next version release of react-native before we can use external packages?

@sunify
Copy link

sunify commented Dec 10, 2015

I think you can use custom transformer with babel 5 (--transformer option for packager and react-native bundle).

@pr1ntr
Copy link

pr1ntr commented Dec 10, 2015

I was having this problem. Then I found this issue and upon opening my computer I found that the last thing i was looking at was this:

https://github.com/alinz/example-react-native-redux/blob/master/Counter/package.json

I looked at @alinz package json and I notice he removes the .babelrc from all his node modules folder. I am not really even sure how this works but for some reason, despite not having any other babelrc file, it does. I am able to import redux fine after running that command. I don't think this a permanent solution but it does work.

@alinz
Copy link

alinz commented Dec 10, 2015

@pr1ntr as @ide mentioned this is babel6 issue which it's incompatible with babel 5 rc files. The real problem is redux included babelrc into repo. Redux's baberc is incompatibale with babel6. So they need to either fixes their babelrc or remove it.

@jaysoo found that removing all babelrc files in all node_modules except the ones in packager will fixes the issue of redux for short time.

@gaearon
Copy link
Collaborator

gaearon commented Dec 12, 2015

Just released [email protected] that doesn't ship .babelrc.

@christopherdro
Copy link
Contributor

Nice @gaearon.

@anshul @pr1ntr Can you guys confirm that this working now so we can close the issue?

Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Dec 12, 2015

I also released [email protected] (3.x is what RN users use for now) without .babelrc.

@jaysoo
Copy link
Contributor

jaysoo commented Dec 13, 2015

@christopherdro @anshul @pr1ntr Can confirm that this fixes it for redux. Might be other node modules that have same problem, but bug should be filed on their repo.

@satya164
Copy link
Contributor

Closing this for now. Let's reopen if issue persists.

@alinz
Copy link

alinz commented Dec 14, 2015

@gaearon This is still happening I think redux-thunk itself still uses .babelrc.stage. Here's the error I'm getting,

{
message: "TransformError: Counter/node_modules/redux-thunk/lib/index.js: [BABEL] Counter/node_modules/redux-thunk/lib/index.js: Unknown option:Counter/node_modules/redux-thunk/.babelrc.stage",
type: "TransformError",
errors: [{ }]
}

The workaround for now is to use the following bash script to get rid of all babelrc files except react-native's ones in order to get the code working.

cd node_modules; find . -name .babelrc | grep -v packager | xargs rm

@satya164 this issue needs to be reopened.

I think all side modules of redux need to be updated.

reduxjs/redux-thunk#43

@ide
Copy link
Contributor

ide commented Dec 14, 2015

The current solution of having every package maintainer (who uses Babel) need to remember to exclude .babelrc is not scalable. We need an option in Babel to say: ignore only the .babelrc files under node_modules.

@alinz
Copy link

alinz commented Dec 14, 2015

@ide agree with your proposal but Babel6 has introduces a lot of api changes. I think this solution would be good for short time. I believe 3rd party modules need to be updated to be compatible with Babel6 or we end up with a lot of messy compatibility code and hacks.

Do you think putting .babelrc in .npmignore would be a bad idea? since npm module should be a production code.

@satya164
Copy link
Contributor

@alinz There is another discussion regarding the issues arising due to the Babel upgrade (not only for Redux, but all 3rd-party libraries which have a .babelrc). Let's track it there - #4062

@alinz
Copy link

alinz commented Dec 15, 2015

@satya164 thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests