blk-design-system-react icon indicating copy to clipboard operation
blk-design-system-react copied to clipboard

[Bug] build not displayed while serving with nginx

Open gpulkitg opened this issue 6 years ago • 1 comments

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

  1. cd blk-design-system-react-master
  2. npm install
  3. npm run build
  4. Configure nginx.conf to serve build folder on port 8080 (configuration is in the additional comments section)
  5. 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;
  }

}

gpulkitg avatar Jun 19 '20 02:06 gpulkitg

Hello there, @pulkit1991 ,

This issue was already solved here: https://github.com/creativetimofficial/blk-design-system-react/issues/4

Best, Manu

einazare avatar Jun 19 '20 05:06 einazare