M
M
mrrangerr2020-05-21 17:30:57
JavaScript
mrrangerr, 2020-05-21 17:30:57

How to deploy create-react-app?

Good evening everyone, I'm trying to put my project on github pages
I did everything as it is written here - https://create-react-app.dev/docs/deployment/#gith...
But I just get an empty page, help me solve this problem .
Maybe it's the routing in the react router dom?

function App() {
  return (
    <Switch>
      <Route path="/" exact component={Home} />
      <Route path="/searched" component={SearchedPhotosList} />
      <Route path="/favorites" component={FavoritesList} />
      <Route path="/history" component={SearchHistory} />
      <Route path="/:id" component={PhotoPage} />
    </Switch>
  );
}

export default App;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitry-toster, 2020-05-21
@mrrangerr

Your path to the JS file itself is not correct. Hence the 404 error and whitelist.
Now he is like this:

https://iznalfiden.github.io/photo-stock/static/js/main.df8cbc61.chunk.js

and should be like this:
https://iznalfiden.github.io/rocketfirm_test/static/js/main.df8cbc61.chunk.js

same for styles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question