question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron main process build failed after upgrated from v1 to v2

See original GitHub issue

Previously 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:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
IlCallocommented, Mar 26, 2021

Fixed by applying noEmit: false only on the node version of Quasar webpack chain: https://github.com/quasarframework/quasar/commit/e87b421dd91979c321035ffdd097238799bcfd26

Will be available with next beta release. Also note we’ll scaffolding directly TS files based on @DarkLite1 PR soon

0reactions
DarkLite1commented, Mar 22, 2021

Same issue, it goes away when using "noEmit" = false in the tsconfig.json file as explained here. But this doesn’t seem to be a good solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows build broken after switching from 22.10.5 to 22.11.3
The first notable thing is even that electron-builder --version output: 22.11.3 when the build process starts it displays version=22.10.5.
Read more >
2 - Stack Overflow
So a cross-build on Ubuntu will fail because the call to electron-builder will call the "after-builds" but this will compile against x64 insteadΒ ......
Read more >
Changelog - Cypress Documentation
Incorporated V8 snapshots into the build process of the Electron binary to improve startup time and reduce the time to download and unzip...
Read more >
Electron start error - Theia Community
It's error message when i start β€œyarn run start” on electron-app. my@my:~/git_repo/theia_yo_extension/electron-app$ yarn run start yarn run v1.
Read more >
Electron's blog
Electron 22.0.0 has been released! It includes a new utility process API, updates for Windows 7/8/8.1 support, and upgrades to Chromium 108 ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found