React wrote Wechat official account web project, on the server, the url address in the tail plus a /, the page blank, how to solve?

problem description

For the Wechat official account web project written by

react, add an extra / at the end of the url address (for example: https://xxx.com/login/), the page is blank.

the environmental background of the problems and what methods you have tried

1. For the local startup project, add an extra / at the end of the url address to access
2. The static files in build/static can be accessed normally without adding / at the end of url. The static files in build/static can be accessed normally. Add / at the end of url and add a directory name in front of the static file in the console.
such as:

url/:  https://xxx/wechat/static/css/main.3c1cb3aa.css 
url/:    https://xxx/wechat/home/static/css/main.3c1cb3aa.css (urlhome,)

what result do you expect? What is the error message actually seen?

I have looked for Baidu, but I still can"t find out what the problem is. Please give me some advice. Thank you in advance.


this is a common problem. Whether adding a slash will cause the actual path of html/js to access the static resource of the relative path to be different. There are two standard solutions:

  1. uses an absolute path to access static resources.
  2. when the server is configured to access an address without a slash, it is automatically redirected to the one with a slash.

each of the two methods has some limitations, so it is good to choose according to the actual situation.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd8609-45685.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd8609-45685.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?