question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need for ejecting create-react-app

See original GitHub issue

I tried using this box this past weekend at ETHWaterloo but ended up just cherry picking the code I needed instead. There were 2 mains reasons for this:

  1. We had already committed some contract code to a bare truffle init project and couldn’t use the unbox command as a result
  2. After looking at the repo I wanted to avoid ejecting create-react-app

The solution we came up with was to create a new react app in a client directory inside the truffle app. This solves the issue of create-react-app and truffle both using a build directory in the same folder. We did run into an issue that create-react-app doesn’t allow importing code from outside of its own src directory which we solved with a symlink.

Here is our project for reference: https://github.com/kevinhughes27/ticket-wicket src directory with symlink https://github.com/kevinhughes27/ticket-wicket/tree/master/client/src

Were there any other reasons for ejecting create-react-app? It will be easier to maintain the box if create-react-app doesn’t need to be ejected.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
adrianmclicommented, Feb 2, 2018

@gre if you are not opposed to Next.js, I’ve created a Truffle Box to work around this: https://github.com/adrianmcli/truffle-next

1reaction
adrianmclicommented, Oct 19, 2017

Yeah I literally copy and pasted the exact same thing + the getWeb3.js from the utils folder. The Web3 object initializes correctly, I tested that out.

I also made sure to install Web3 and truffle-contract. Literally the only difference should be the fact that it’s not an ejected project (or maybe I’m missing a dependency?). I’ll make a repo and post it here ago tho, thanks for taking a quick look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't eject your Create React App | by Adam Laycock - Medium
There's nothing wrong with ejecting — there's a reason it was built into CRA. There are workarounds and escape-hatches that are worth exploring, ......
Read more >
Don't Eject! – Why to Leave your Create React App in the Disc ...
Ejecting your React app has major tradeoffs. It gives you all the configuration you want, but it's time-consuming, expensive, and requires a lot ......
Read more >
What does this "react-scripts eject" command do?
Ejecting lets you customize anything, but from that point on you have to maintain the configuration and scripts yourself. This can be daunting ......
Read more >
Overriding the Create-React-App Webpack Configuration ...
While it uses Webpack under the hood, the WebPack configuration is not exposed to the user - unless you decide to eject ....
Read more >
Should you eject your Create React App? - Nathan Sebhastian
When you run npm run eject command in your React application, you will be able to edit the configuration and script files. You...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found