Where is the bundle.js for the react project?

where is the react project created with cra scaffolding? where is bundle.js?

clipboard.png
clipboard.png

react runs on port 3000 by default, and there is no error above when it runs directly. However, because it needs to cross domains, a reverse proxy is set up with nginx, and the above error occurs. The nginx.conf configuration is as follows:

   server {
        listen       3001;
        server_name  localhost;

 
        location / {
            proxy_pass http://localhost:3000;
        }


        location /api { 
            proxy_pass  http://192.168.33.3:8080;    
        }  


        location ~ \.(htm|html|js|css|jpg|png|gif|eot|svg|ttf|woff|woff2)$ {  
            root    html;     
        }    
                
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

so, what"s the problem and how should it be set up?

Mar.24,2022

I don't have your problem when using cra scaffolding and proxies. Take a look at your Nginx configuration and guess if it will be the third configuration. What's wrong with static resource route redirection? In addition, in fact, cra itself supports proxies and does not need to be tested by Nginx,. The implementation is the configuration of webpack-dev-Server, and the specific operation can be done under Baidu.

Menu