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.

Namespace 'Electron.CrossProcessExports' has no exported member 'Remote'.

See original GitHub issue

(found on Windows).

How to reproduce:

ionic start example tabs --type=angular
cd example
npm i ngx-electron --save

After that I change src/app/app.module.ts from:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
  bootstrap: [AppComponent],
})
export class AppModule {}

to

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NgxElectronModule } from 'ngx-electron';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, NgxElectronModule],
  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
  bootstrap: [AppComponent],
})
export class AppModule { }

Then I spawn ionic build and I get the following error:

Error: node_modules/ngx-electron/lib/electron.service.d.ts:17:31 - error TS2694: Namespace 'Electron.CrossProcessExports' has no exported member 'Remote'.

17     readonly remote: Electron.Remote;
                                 ~~~~~~

My package.json file:

{
  "name": "example",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~12.1.1",
    "@angular/core": "~12.1.1",
    "@angular/forms": "~12.1.1",
    "@angular/platform-browser": "~12.1.1",
    "@angular/platform-browser-dynamic": "~12.1.1",
    "@angular/router": "~12.1.1",
    "@capacitor/app": "1.0.3",
    "@capacitor/core": "3.2.4",
    "@capacitor/haptics": "1.1.0",
    "@capacitor/keyboard": "1.1.0",
    "@capacitor/status-bar": "1.0.3",
    "@ionic/angular": "^5.5.2",
    "ngx-electron": "^2.2.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.1.1",
    "@angular-eslint/builder": "~12.0.0",
    "@angular-eslint/eslint-plugin": "~12.0.0",
    "@angular-eslint/eslint-plugin-template": "~12.0.0",
    "@angular-eslint/template-parser": "~12.0.0",
    "@angular/cli": "~12.1.1",
    "@angular/compiler": "~12.1.1",
    "@angular/compiler-cli": "~12.1.1",
    "@angular/language-service": "~12.0.1",
    "@capacitor/cli": "3.2.4",
    "@ionic/angular-toolkit": "^4.0.0",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.16.1",
    "@typescript-eslint/parser": "4.16.1",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~3.8.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "typescript": "~4.2.4"
  },
  "description": "An Ionic project"
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:13

github_iconTop GitHub Comments

5reactions
andelzcommented, Oct 30, 2021

Looks like the remote module has been deprecated in Electron 12 and been removed in Electron 14 (https://www.electronjs.org/blog/electron-14-0#removed-remote-module). They moved the remote stuff into its own package (https://github.com/electron/remote/blob/main/README.md). So as a quick fix I would assume that downgrading to version 13 should do the trick. But of cource I would love to see this change reflected in ngx-electron.

4reactions
HiveTechDevcommented, Mar 30, 2022

Note: I ran into this as well. looks like still not fixed with npx-electron.

one addition to helping others. when you make your local change, use the package: patch-package https://www.npmjs.com/package/patch-package

You can make the edit, store the edit in your local repo, then tie it into post-install so it applies the edit again for future npm installations/other machines on your project. see patch-package readme.

Again, unfortunate but, this at least saves you from editing it every time, or scripting it yourself.

creates folder patches, in it you find a file and can see your delta in there:

-    readonly remote: Electron.Remote;
+    readonly remote: any;

working well for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Namespace 'Electron.CrossProcessExports' has no exported ...
Go to the node_modules/ngx-electron/lib/electron.service.d.ts and comment the line -> readonly remote: Electron.Remote;.
Read more >
@electron/remote - npm
electron /remote` is an [Electron](https://electronjs.org) module that bridges JavaScript objects from the main process to the renderer ...
Read more >
Issues · ThorstenHans/ngx-electron · GitHub
Namespace 'Electron.CrossProcessExports' has no exported member 'Remote'. #71 opened Oct 2, 2021 ; Support @electron/remote instead of the old require('electron ...
Read more >
Errors: has no exported member - Angular - EJ 2 - Syncfusion
Error: node_modules/@syncfusion/ej2-angular-buttons/src/switch/switch.module.d.ts:8:25 - error TS2694: Namespace ...
Read more >
[Solved]-Namespace 'google.maps' has no exported member ...
Coding example for the question Namespace 'google.maps' has no exported member 'MouseEvent'. with installation of @agm/core and @types/google-angular.js.
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