While working on developing a client using Electron with Typescript, I encountered the following error:
https://i.sstatic.net/7qLGh.png
The configuration in tsconfig.json
looks like this:
{ "compilerOptions": { "target": "es5", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports&qu... <p>As for the <code>package.json
, it is structured as follows:{ "name": "electron-quick-start-typescript", "version": "1.0.0", "description": "A minimal Electron application written with Typescript", "scripts": { "build": "tsc", "watch": "tsc -w", "lint": "eslint -c .eslintrc --ext .ts ./src", "start": "npm run build && electron --no-sandbox ./dist/main.js" }, "type": "module", "repository": "https://github.com/electron/electron-quick-start-typescript", ... <p>I have been encountering errors regardless of the module type selected in <code>tsconfig
, either due to the use ofrequire
in generated JS files (which are used as scripts on the browser) or during the compilation process of TS files. Any guidance on how to address these issues would be highly appreciated. Thank you in advance.