Cannot require bytenode jsc file in electron
See original GitHub issueHi. Please help me in this case. I’m using electron-vuejs template from this https://github.com/SimulatedGREG/electron-vue
This project, it didn’t use command electron .
, but using a js file to start electron. You can check in package.json (https://github.com/SimulatedGREG/electron-vue/blob/master/template/package.json)
"dev": "node .electron-vue/dev-runner.js",
When I require bytenode jsc file in this js file (dev-runner.js
), it works.
But when I require jsc file in src/main/index.js , it show error
ERROR in ./src/main/config.jsc 1:0 Module parse failed: Unexpected character ‘�’ (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file) @ ./src/main/index.js 7:13-36 @ multi ./src/main/index.dev.js ./src/main/index.js
Can you please check it ?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top GitHub Comments
Hey there, I solved the same problem by using
__non_webpack_require__(fileLocation)
in the main process orrequire('electron').remote.require(fileLocation)
in the render process (Vue.js).Example
main.js
Example
HelloWorld.vue
thank you