title: Electron-Typescript app crashes due to module
body: <p>I'm trying to build a client that runs on Electron with Typescript, however, I get the following error:</p>
  <p><a href="https://i.stack.imgur.com/7qLGh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7qLGh.png" alt="enter image description here" /></a></p>
  <p>The <code>tsconfig.json</code> is as follows:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;es5&quot;,
      &quot;lib&quot;: [
        &quot;dom&quot;,
        &quot;dom.iterable&quot;,
        &quot;esnext&quot;
      ],
      &quot;allowJs&quot;: true,
      &quot;skipLibCheck&quot;: true,
      &quot;esModuleInterop&quot;: true,
      &quot;allowSyntheticDefaultImports&quot;: true,
      &quot;strict&quot;: true,
      &quot;useUnknownInCatchVariables&quot;: false,
      &quot;forceConsistentCasingInFileNames&quot;: true,
      &quot;noFallthroughCasesInSwitch&quot;: true,
      &quot;module&quot;: &quot;esnext&quot;,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;resolveJsonModule&quot;: true,
      &quot;isolatedModules&quot;: true,
      &quot;noEmit&quot;: true,
      &quot;typeRoots&quot;: [
        &quot;node_modules/@types&quot;,
        &quot;src/types&quot;
      ],
      &quot;jsx&quot;: &quot;react-jsx&quot;
    },
    &quot;include&quot;: [
      &quot;src&quot;
    ]
  }
  </code></pre>
  <p>And <code>package.json</code> is like so:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;name&quot;: &quot;electron-quick-start-typescript&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;A minimal Electron application written with Typescript&quot;,
    &quot;scripts&quot;: {
      &quot;build&quot;: &quot;tsc&quot;,
      &quot;watch&quot;: &quot;tsc -w&quot;,
      &quot;lint&quot;: &quot;eslint -c .eslintrc --ext .ts ./src&quot;,
      &quot;start&quot;: &quot;npm run build &amp;&amp; electron --no-sandbox ./dist/main.js&quot;
    },
    &quot;type&quot;: &quot;module&quot;,
    &quot;repository&quot;: &quot;https://github.com/electron/electron-quick-start-typescript&quot;,
    &quot;keywords&quot;: [
      &quot;Electron&quot;,
      &quot;quick&quot;,
      &quot;start&quot;,
      &quot;tutorial&quot;,
      &quot;demo&quot;,
      &quot;typescript&quot;
    ],
    &quot;author&quot;: &quot;GitHub&quot;,
    &quot;license&quot;: &quot;CC0-1.0&quot;,
    &quot;devDependencies&quot;: {
      &quot;@types/axios&quot;: &quot;^0.14.0&quot;,
      &quot;@types/electron&quot;: &quot;^1.6.10&quot;,
      &quot;@types/jquery&quot;: &quot;^3.5.14&quot;,
      &quot;@types/node&quot;: &quot;^17.0.42&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.33.0&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.33.0&quot;,
      &quot;electron&quot;: &quot;^18.2.3&quot;,
      &quot;eslint&quot;: &quot;^7.32.0&quot;,
      &quot;typescript&quot;: &quot;^4.7.2&quot;
    },
    &quot;dependencies&quot;: {
      &quot;axios&quot;: &quot;^0.27.2&quot;,
      &quot;jquery&quot;: &quot;^3.6.0&quot;
    }
  }
  </code></pre>
  <p>I've been getting errors no matter what module type I select in <code>tsconfig</code> either due to the usage of <code>require</code> in generated JS files (which I use as scripts on the browser) or due to the compilation process of TS files. Any tips are appreciated. Thanks in advance.</p>