Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_IPC_CHANNEL_CLOSED: Channel closed #475

Closed
marcoippolito opened this issue Aug 9, 2020 · 3 comments
Closed

ERR_IPC_CHANNEL_CLOSED: Channel closed #475

marcoippolito opened this issue Aug 9, 2020 · 3 comments

Comments

@marcoippolito
Copy link

When I try to call an async function from dialog.showOpenDialog I get this error and the window crashes:

image

called function:

import { createWorker } from 'tesseract.js'
const path = require('path')

const worker = createWorker();

export default async function imgToText(imgFilePath: string): Promise<void> {
  const image = path.resolve(__dirname, imgFilePath)
  await worker.load();
  //await worker.loadLanguage('eng');
  //await worker.initialize('eng');
  //const { data: { text } } = await worker.recognize(image);
  //console.log(text);
  //await worker.terminate();
}

This is the calling function :

async function loadFile() {
  dialog.showOpenDialog({
    properties: ['openFile', 'multiSelections'],
  }).then(result => {
    result.filePaths.forEach((filepath: string) => {
      imgToText(filepath);
    })
  }).catch(err => {
    console.log(err)
  })
}

Other info:

Electron version: 9.0.0
Typescript version: 3.9.7
tesseract.js version: 2.1.1
System:
  OS: Linux 5.4 Ubuntu 18.04.4 LTS (Bionic Beaver)
  CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Binaries:
  Node: 14.5.0 - ~/.nvm/versions/node/v14.5.0/bin/node
  Yarn: 1.22.4 - /usr/bin/yarn
  npm: 6.14.5 - ~/.nvm/versions/node/v14.5.0/bin/npm
Browsers:
  Chrome: 84.0.4147.105
  Firefox: 79.0

How to solve the problem?
Looking forward to your kind help.
Marco

@Ganeshjadhav221b
Copy link

Any updates/workarounds on this? Im facing same issue.

@crohit92
Copy link

crohit92 commented Feb 6, 2022

I am also getting the same error.

@Balearica
Copy link
Member

Closing this issue as the master branch now uses worker_threads rather than child_process (per #630). Therefore, you should not encounter this particular error again. If you encounter a new error, feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants