chatd icon indicating copy to clipboard operation
chatd copied to clipboard

Selected file will not load

Open fezzzza opened this issue 1 year ago • 12 comments

In the latest release 1.1.0 on Linux Mint 21 Vanessa (~ Ubuntu 22.04), the selected file will not load, regardless of which filetype I select. The button contains the text Cannot find module '/[path/to]/chatd-linux-x64/src/service/worker.js' where [path/to] is where I installed it. Chatd is useless without being able to load a file. Reverting to v1.0.1 is the workaround.

fezzzza avatar Feb 24 '24 00:02 fezzzza

image Same on Win 11 23H2 - won't load any files.

scsmash3r avatar Mar 05 '24 01:03 scsmash3r

Issue still persists in a tagged v.1.1.1 There was a report that gives a sight on that one: https://github.com/BruceMacD/chatd/issues/25#issuecomment-1961340322

Current workaround would be:

  1. Go to resources\app\src\ folder
  2. Edit file api.js on line 149:
  const worker = new Worker('./resources/app/src/service/worker.js');
  1. Re-run chatd.exe - should be able to upload documents now and do the prompt.

scsmash3r avatar Mar 06 '24 03:03 scsmash3r

I have used the latest version (v1.1.1) currently available, and when I select to upload the file, it prompts "Cannot find module 'C:\tmp\chatd-win32-x64\src\service\worker.js'

When I switch to Resources\app in the CMD environment and run chatd.exe, when uploading the file, I will see "fetch failed" Prompt in CMD log

Error: TypeError [Error]: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:14152:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at process.processImmediate (node:internal/timers:447:9)
    at async getModelFile (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/utils/hub.js:471:24)
    at async getModelJSON (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/utils/hub.js:575:18)
    at async Promise.all (index 0)
    at async loadTokenizer (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/tokenizers.js:52:16)
    at async AutoTokenizer.from_pretrained (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/tokenizers.js:3940:48)
    at async Promise.all (index 0)
    at async loadItems (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/pipelines.js:2694:5)
    at async pipeline (file:///C:/tmp/chatd-win32-x64/resources/app/node_modules/@xenova/transformers/src/pipelines.js:2640:19)
    at async embed (C:\tmp\chatd-win32-x64\resources\app\src\service\embedding.js:22:21)
    at async MessagePort.<anonymous> (C:\tmp\chatd-win32-x64\resources\app\src\service\worker.js:10:24) {
  cause: ConnectTimeoutError: Connect Timeout Error
      at onConnectTimeout (node:internal/deps/undici/undici:7967:28)
      at node:internal/deps/undici/undici:7925:50
      at Immediate._onImmediate (node:internal/deps/undici/undici:7954:37)
      at process.processImmediate (node:internal/timers:476:21)

image

Jackxwb avatar Mar 07 '24 12:03 Jackxwb

Same issue with v 1.1.0 on Mac OS. Changed the path to the worker to './resource/app/src/service/worker.js' but still complaining and not loading the file.

didikrm avatar Mar 17 '24 10:03 didikrm

Same issue with v 1.1.0 on Mac OS. Changed the path to the worker to './resource/app/src/service/worker.js' but still complaining and not loading the file.

Probably you forgot to add s in resources, so the correct path must be ./resources/app/src/service/worker.js - recheck and try again.

scsmash3r avatar Mar 17 '24 15:03 scsmash3r

This was my typo. It still shows an error msg that it can't find the module.

didikrm avatar Mar 18 '24 11:03 didikrm

I had this issue mine worked by adding an absolute path to the file e.g for me it was /Applications/chatd.app/Contents/Resources/app/src/service/worker.js

jjohnlaw avatar Mar 20 '24 12:03 jjohnlaw

I had this issue mine worked by adding an absolute path to the file e.g for me it was /Applications/chatd.app/Contents/Resources/app/src/service/worker.js

I had the same issue. @jjohnlaw this worked for me too :) thx

bgruszka avatar Mar 21 '24 09:03 bgruszka

I had this issue mine worked by adding an absolute path to the file e.g for me it was /Applications/chatd.app/Contents/Resources/app/src/service/worker.js

I had the same issue. @jjohnlaw this worked for me too :) thx

Worked for me as well. Thank you @jjohnlaw

didikrm avatar Mar 22 '24 19:03 didikrm

I had this issue mine worked by adding an absolute path to the file e.g for me it was /Applications/chatd.app/Contents/Resources/app/src/service/worker.js

worked thanks

justarmadillo avatar Mar 30 '24 16:03 justarmadillo

I had this issue mine worked by adding an absolute path to the file e.g for me it was /Applications/chatd.app/Contents/Resources/app/src/service/worker.js

This does not solve the problem for me, i'm using windows, should I use something like "C:\folder-where-is-worker\worker.js" ?

edemir206 avatar Apr 20 '24 18:04 edemir206

Same issue on Ubuntu 18.04:

Error: Cannot find module '/home/me/software/chatd-linux-x64/src/service/worker.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1054:15)
    at Module._load (node:internal/modules/cjs/loader:900:27)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:96:12)
    at MessagePort.<anonymous> (node:internal/main/worker_thread:161:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:735:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

@scsmash3r 's workaround fixed it

glhr avatar Jun 03 '24 15:06 glhr