-1

I'm confused. without html-webpack-plugin plugin I can run my project and it works fine:

yarn start

url:

http://localhost:3000/

My project is finished. now I want to build my project and I want to upload on server.

my project works with Api.

now, I think I should use html-webpack-plugin to get a build file. to do this I run this command:

npm run build

and It makes a dist directory that inside of it is:

enter image description here


I uploaded my content of my dist on server:

http://www.shadyab.com/test20/index.html

I got this error on console:

Warning: [react-router] Location "/test20/index.html" did not match any routes

whole my project:

https://github.com/smemamian/shadyab

1 Answer 1

1

You need to hit root url i.e. / not index.html

http://www.shadyab.com/test20

If you want to map /index.html to root url, add a rule in react-router.

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

but I got the same error with your url: http://www.shadyab.com/test20
I got some UI with bad css :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.