[Bug] build not displayed while serving with nginx
Version
1.1.0
Reproduction link
https://github.com/creativetimofficial/blk-design-system-react
Operating System
MacOS
Device
Macbook Pro
Browser & Version
Chrome, Version 83.0.4103.106 (Official Build) (64-bit)
Steps to reproduce
- cd blk-design-system-react-master
- npm install
- npm run build
- Configure nginx.conf to serve build folder on port 8080 (configuration is in the additional comments section)
- Visit localhost:8080
What is expected?
When visiting localhost:8080, this website should be displayed in the browser: https://demos.creative-tim.com/blk-design-system-react/#/components
What is actually happening?
Blank page is being displayed
Solution
Modification of paths to the assets in the source code is probably needed for nginx to serve them correctly.
Additional comments
I tried it with multiple node versions as well:
$ nvm ls
v10.21.0
-> v12.18.1
v14.4.0
system
Also, I repeated the above steps for a bootstrap app created using create-react-app and the app was correctly displayed by nginx server. I also repeated it with templates by other authors and it was working correctly. So there is no issue with nginx configuration.
Server configuration in nginx.conf:
server {
listen 8080;
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
root /Users/<username>/workspace/blk-design-system-react-master/build;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
}
Hello there, @pulkit1991 ,
This issue was already solved here: https://github.com/creativetimofficial/blk-design-system-react/issues/4
Best, Manu