hyva-themes / magento2-checkout-example

A React Checkout template that allows you to quickly create a customized Hyvä Checkout for your project.
11 stars 2 forks source link

Overriding files is unstable #24

Open ultramaryna opened 2 years ago

ultramaryna commented 2 years ago

Overriding files from the original React Checkout is unstable. When you are running the app in developer mode (npm run start), overriding (as described here: https://github.com/hyva-themes/magento2-checkout-example#copying-react-components) doesn't always work. Restarting the app doesn't help. You need to make a production build to see your changes.

It's not always the case and it's been hard to track when exactly it happens. In our team of three, it happened for some of us more often than for the others. We use Mac, Docker and node 16.

Discussion from Hyva slack: https://hyva-themes.slack.com/archives/C01C5DBHL64/p1650025097720269

rajeev-k-tomy commented 2 years ago

A work around I found for this problem is given below.

  1. You already started the app in development mode npm start.
  2. Now, a situation came where you want to add a new file (which exists already in the original module) into example module. You are adding it.
  3. Seems no changes on the frontend.
  4. Kill the process. Cntrl + C.
  5. Remove cache directory directly rm -rf node_modules/.cache.
  6. Start the app again npm start
  7. You should see the new file is picked up without problems.