how to load electron module in typescript

2er0 - 3n23square

I try to get the ipcRenderer module from electron in typescript to send informations from the current component to the core and to get informations back to the window (electron-chromium-browser). All I get is a error "Module not found" by transcoding the ts-code to ES5.

const ipc = require('electron').ipcRenderer;`

Update: The Error is switching between the "Module not found" and this one:

ERROR in ./~/electron/index.js Module build failed: Error: ENOENT, open '/.../node_modules/electron/index.js' @ ./app/components/search/search.ts 12:10-29

That is from the current electron-api. I have also tried to use the import syntax from typescript but the result is the same.

Than I tried to use the electron.ipcRenderer module in a ES5-file, loaded/linked directly in the html-file.

There it worked. Why?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Electron Failed to load Module

From Dev

How do I properly load the lit-html module in Electron

From Dev

How to fix: "Failed to load module script ..." Angular 8, Electron 5

From Dev

Electron and typescript "Cannot find module 'electron'"

From Dev

Typescript, cant load internal module

From Dev

How to load a module in initrd?

From Dev

Electron - How to load a html file into the current window?

From Dev

How load html from renderer JS with ELECTRON

From Dev

How to configure webpack for "require(ffi)' module in electron?

From Dev

How to use Hot Module Replacement with Electron

From Dev

Load CSS module in ReactJS + Typescript and react rewired

From Dev

How to reference node fs API with electron in typescript?

From Dev

How to use typescript in electron without having to compile?

From Dev

How to set up Electron with React and TypeScript?

From Dev

Webpack: How to load the module on page load?

From Dev

How to load a module before another module loads?

From Dev

How to load module into python with argv

From Dev

How to wait for Angular module to load?

From Dev

How to load a wasm module locally?

From

How to manually lazy load a module?

From Dev

How to load tun module in linux?

From Dev

How to import module correct in Typescript?

From Dev

TypeScript - how to import 'os' module

From Dev

how to include typescript module declarations

From Dev

How to create a local module in TypeScript

From Dev

How to import local typescript module?

From Dev

How to export a TypeScript module for SystemJS?

From Dev

How to mock a module with typescript namespace?

From Dev

How to merge typescript module defintions

Related Related

HotTag

Archive