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

Serve crashes if the app is ejected #51

Open
angelcustodio opened this issue Feb 20, 2019 · 5 comments
Open

Serve crashes if the app is ejected #51

angelcustodio opened this issue Feb 20, 2019 · 5 comments

Comments

@angelcustodio
Copy link

Everything works fine without ejecting the app but if you yarn eject, then... 💥
yarn build do the job correctly but yarn serve returns this problem:

/cra-ssr/node_modules/@babel/runtime/helpers/esm/objectSpread.js:1
(function (exports, require, module, __filename, __dirname) { import defineProperty from "./defineProperty";
                                                                     ^^^^^^^^^^^^^^

I assume it's related with Node being unable to resolve ES6 imports, right?
Is there any workaround or solid fix for it? Maybe babel-node?

@koyta
Copy link

koyta commented Mar 4, 2019

@angelcustodio you fixed this?

@angelcustodio
Copy link
Author

Running babel-node works but there should be some kind of magic with some dependency. In any case, it can be workarounded tweaking a lot the Babel configuration but it's not straightforward. I'll probably work on it a few days to have it clean and clear and do a PR if you think it's useful enough :)

@koyta
Copy link

koyta commented Mar 5, 2019

@angelcustodio I fixed this by installing few packages for babel, edited server/index.js config, edited babel config in package.json and edit webpack.config.js. Also I removed babel-preset-react-app for @babel/preset-react one

Here's my gists of working configs:

You can make diff and see what you must change after eject

P.S. Configs are prettified with prettier, sorry :)

@12finger
Copy link

12finger commented May 21, 2019

@koyta would really love to see the diff of the changes so i can apply them easier.

@cereallarceny cereallarceny mentioned this issue Jun 19, 2019
16 tasks
@cereallarceny
Copy link
Owner

Hey, my apologies for the long wait @angelcustodio - I'm looking to ensure this is fixed with version 2.0. If you're interested, I could really use your thoughts for what you'd like to see in the upcoming version. Feel free to comment on the issue here with any suggestions. :)

@12finger @koyta In the future we will support both ejected and non-ejected CRA builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants