-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
.babelrc and eject script #1806
Comments
Good catch. I don’t understand why end-to-end test passes on master. 😳 This doesn’t affect our users because they’re on |
(The fix would be to hardcode Babel and ESLint "configs" since they're one liners.) |
This is showing up in Travis logs:
We should somehow enable this behavior sooner in end-to-end test. And I don't understand how the project still builds after ejecting on CI without those fields.. |
OK, this is embarrassing. Our end-to-end test doesn’t verify that ejection actually happened. So we get an unhandled Promise rejection, ejecting stops, but since it doesn’t exit with an error, the project is still in half-working state, and so it passes the rest of the end-to-end test. If you’d like to help, please send a PR that:
appPackage.babel = {presets: 'react-app'};
appPackage.eslintConfig = {extends: 'react-app'}; |
Hey, thanks for investigating so quickly! I'm not sure I'm the right man for this since I've never done tests in my life (I know this is wrong, but I'll have a look and make up for it), but I was curious on point 3 why we should not read from the file and just change .babelrc to babelrc? Unless there is absolutely no reason in the future to add other lines to babelrc and eslintrc? |
@dbismut you can do it! We're here to help. 😄 As for point three, we simply use these files for the ejection process -- they're not used internally by Looks like throwing on an unhandled rejection will be the default behavior in Node 8. For now, looks like we can opt-in like so: process.on('unhandledRejection', err => {
throw err;
}); We should probably add this to A PR implementing 1 and 2 would be a great start (to see an actual failure), we can talk about 3 then. Thanks so much! |
@gaearon It does fix it! |
@dbismut did you want to send a PR adding the unhandled rejection throwing to scripts? |
@Timer I would have loved to and currently looking into it, but by the time I understand how all this work, I'm afraid you'd be losing patience. I just figured out how to run tests from the tasks folder (not that I've been spending my whole time at this but still)... |
Oh no, nothing like that. I just wasn't sure if you wanted to do it. Sorry if I came off that way. |
Haha no worries... I want to try, but I'll let you know if I don't think I can make it by EOD tomorrow. |
process.on('unhandledRejection', err => {
throw err;
}); |
Does something like this work? process.on('unhandledRejection', err => {
console.log(err);
process.exit(1);
}); |
Forget about what I said. What @Timer wrote actually works 🙃 |
Hm, it should work because we run the installer from a packed copy. Is it exhibiting behavior that this doesn't happen? If so, that's interesting! |
I'm off my desk but will try this tomorrow morning GMT. Yes I'm indeed using yarn. All I can say for now is that the code I modified in the eject.js file wasn't executed in the test! Anyway thanks for your help, I've learned a lot today ;) |
@Timer Indeed you're right, running Here is the output of So I guess it solves @gaearon's point number 2? I have 3 questions then:
Thanks! |
Thanks for being on top of this! |
@Timer done! However I re-ran into the |
This is a known Yarn bug (it will be fixed), see yarnpkg/yarn#2649 and yarnpkg/yarn#2165. I thought we clean the cache in one of them ... |
You do in all actually. Not sure why I ran into this issue then... |
Ah, you need to have |
Thanks @dbismut! |
My pleasure, thanks for the help and patience, I just followed instructions 💂 |
Hey - I'm very new (or at least I'm far from understanding everything) but working on a fork of this project using
inferno
, I'm running into an issue with the eject script, namely that the.babelrc
file can't be found.Looking at the code of
react-scripts
and specifically this line, it looks like the eject script looks for a file called.babelrc
(notice the dot).During this commit
.babelrc
was renamed tobabelrc
.I'm not running into bugs with
create-react-app
, but I was wondering if everything was normal?The text was updated successfully, but these errors were encountered: