Communication problems after using create-react-app in electron

refer to https://www.jianshu.com/p/208. blog implementation, but it is not successful, prompting
(index): 29 Uncaught ReferenceError: require is not defined

at (index):29

excuse me, what should I do?


he should have some settings in webpack. You can use require, directly in the browser environment. Normally, the browser environment cannot directly use reqiure, if you do not use the main process to communicate with the rendering process

Communication between Create-react-app and Electron threads
You don't have to read the latter part of that article. If you want to, I don't think it's officially recommended. You can delete all the code behind the above "communication between Create-react-app and Electron" and then communicate according to electron official implementation of communication between the main process and the rendering process or , which is actually quite simple. Is to register to listen

The require in

html is not needed, it can be deleted, and it can be used to communicate through window.electron.

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