After the ant-design-pro project npm run build, the browser opens and reports an error.

simply write a project with ant-design-pro, and write a server.js and npm run build packaged file in the root directory with the built-in mock API,. The dist directory is as follows:

server.js:


server.js302Cannot read property "notifyCount" of undefined:

the user part remains unchanged, and the data sent from the server can be output normally in the console. I don"t understand what went wrong. After the browser can display, npm run build normally, npm start opens an error in browser 127.0.0.1, npm run build 9008. How can you solve this problem?


npm run build cannot be opened with self-written server.js

what does this mean? from the code point of view, server.js is a static resource service running on the server side, so why it should be packaged to dist, but cannot be run on the browser side, am I wrong?


the packaged project needs to be supported by the web container, that is, it needs to run into the web container, such as nginx.
mock data packaged out is invalid. In the case of build, the mock data is not packaged. You must point the address in the server.js to a service address, usually in the form of a proxy.

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-1e9a23c-47578.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-1e9a23c-47578.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?