From 90dece49849daf8d9054ec50aa31ee83f74cdb87 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 16 Mar 2022 20:26:18 +0530 Subject: [PATCH] chore: rename renderer to main cause bug --- src/{renderer.ts => main.js} | 14 ++++++-------- vue.config.js | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) rename src/{renderer.ts => main.js} (89%) diff --git a/src/renderer.ts b/src/main.js similarity index 89% rename from src/renderer.ts rename to src/main.js index c2757c58..7012b98d 100644 --- a/src/renderer.ts +++ b/src/main.js @@ -2,8 +2,8 @@ import { ipcRenderer } from 'electron'; import frappe from 'frappe'; import { createApp } from 'vue'; import models from '../models'; -import App from './App.vue'; -import FeatherIcon from './components/FeatherIcon.vue'; +import App from './App'; +import FeatherIcon from './components/FeatherIcon'; import config, { ConfigKeys } from './config'; import { getErrorHandled, handleError } from './errorHandling'; import { incrementOpenCount } from './renderer/helpers'; @@ -19,7 +19,6 @@ import { setLanguageMap, stringifyCircular } from './utils'; } if (process.env.NODE_ENV === 'development') { - // @ts-ignore window.config = config; } @@ -31,7 +30,6 @@ import { setLanguageMap, stringifyCircular } from './utils'; ipcRenderer.send = getErrorHandled(ipcRenderer.send); ipcRenderer.invoke = getErrorHandled(ipcRenderer.invoke); - // @ts-ignore window.frappe = frappe; window.onerror = (message, source, lineno, colno, error) => { @@ -54,7 +52,7 @@ import { setLanguageMap, stringifyCircular } from './utils'; frappe() { return frappe; }, - platform(): string { + platform() { switch (process.platform) { case 'win32': return 'Windows'; @@ -74,7 +72,7 @@ import { setLanguageMap, stringifyCircular } from './utils'; }); app.config.errorHandler = (err, vm, info) => { - const more: Record = { + const more = { info, }; @@ -86,14 +84,14 @@ import { setLanguageMap, stringifyCircular } from './utils'; more.props = stringifyCircular(vm.$props ?? {}, true, true); } - handleError(false, err as Error, more); + handleError(false, err, more); console.error(err, vm, info); }; incrementOpenCount(); app.mount('body'); - process.on('unhandledRejection', (error: Error) => { + process.on('unhandledRejection', (error) => { handleError(true, error); }); diff --git a/vue.config.js b/vue.config.js index 3dd31d45..890a3e37 100644 --- a/vue.config.js +++ b/vue.config.js @@ -6,7 +6,7 @@ module.exports = { electronBuilder: { nodeIntegration: true, mainProcessFile: 'main.ts', - rendererProcessFile: 'src/renderer.ts', + // rendererProcessFile: 'src/renderer.js', disableMainProcessTypescript: false, mainProcessTypeChecking: true, chainWebpackRendererProcess: (config) => {