Electron main process build failed after upgrated from v1 to v2
See original GitHub issuePreviously quasar dev -m electron can start my project normally. When I upgrade to quasar v2, after solved all reported errors of the renderer process code, according to quasar upgrade guide, and adjust files according to the Upgrade guide on Electron , the Webpack build process of the main process code report the following error.
β’ Compiling: βββ Renderer process ββββββββββββββββββββ 100% done in 84833 ms βββ Preload process βββ 10% building 1/2 modules 1 active βββ Main process ββββββββββββββββββββ 100% done in 30629 ms
App Β· Webpack built Electron main process
Hash: 4e75f4a0f10d0d277d02 Version: webpack 4.44.1 Time: 30636ms Built at: 2021-03-03 8:07:12 βF10: PMβ€ Asset Size Chunks Chunk Names electron-main.js 5.56 KiB electron-main electron-main Entrypoint electron-main = electron-main.js
ERROR in ./src-electron/electron-main.ts Module build failed (from ./node_modules/ts-loader/index.js): Error: TypeScript emitted no output for D:\Learn\web\quasar\myproject\src-electron\electron-main.ts.
-
index.js:53 makeSourceMapAndFinish [myproject]/[ts-loader]/dist/index.js:53:18
-
index.js:40 successLoader [myproject]/[ts-loader]/dist/index.js:40:5
-
index.js:23 Object.loader [myproject]/[ts-loader]/dist/index.js:23:5
@ multi ./src-electron/electron-main electron-main[0]
App Β· β οΈ Electron main build failed with errors
β’ Compiling: βββ Renderer process ββββββββββββββββββββ 100% done in 84833 ms βββ Preload process ββββββββββββββββββββ 100% done in 57787 ms βββ Main process ββββββββββββββββββββ 100% done in 30629 ms
App Β· Webpack built Electron preload process
Hash: d5daa056daaddb3fe6da Version: webpack 4.44.1 Time: 57790ms Built at: 2021-03-03 8:07:40 βF10: PMβ€ Asset Size Chunks Chunk Names electron-preload.js 5.59 KiB electron-preload electron-preload Entrypoint electron-preload = electron-preload.js
ERROR in ./src-electron/electron-preload.ts Module build failed (from ./node_modules/ts-loader/index.js): Error: TypeScript emitted no output for D:\Learn\web\quasar\myproject\src-electron\electron-preload.ts.
-
index.js:53 makeSourceMapAndFinish [myproject]/[ts-loader]/dist/index.js:53:18
-
index.js:40 successLoader [myproject]/[ts-loader]/dist/index.js:40:5
-
index.js:23 Object.loader [myproject]/[ts-loader]/dist/index.js:23:5
@ multi ./src-electron/electron-preload electron-preload[0]
App Β· β οΈ Electron preload build failed with errors
Platform (please complete the following information): Quasar Version: 2.0.0-beta.8 @quasar/app Version: 3.0.0-beta.8 Quasar mode: [x] SPA [x] Electron
OS: win10 Node: v12.18.4 NPM: 6.14.9 Yarn: 1.22.5 Electron: 11.3.0
electron-preload.ts:
import {contextBridge} from 'electron';
import {tmpdir} from 'os';
contextBridge.exposeInMainWorld("napi",{
os:{
tmpdir,
},
})
could you please tell me what is the problem and how can I solve it. thank you. I have been stuck for two days.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Fixed by applying
noEmit: false
only on the node version of Quasar webpack chain: https://github.com/quasarframework/quasar/commit/e87b421dd91979c321035ffdd097238799bcfd26Will be available with next beta release. Also note weβll scaffolding directly TS files based on @DarkLite1 PR soon
Same issue, it goes away when using
"noEmit" = false
in thetsconfig.json
file as explained here. But this doesnβt seem to be a good solution.