fxmarty / rikai-mpv

A port of Rikaichamp Japanese dictionary and parser into mpv video player
MIT License
33 stars 3 forks source link

Can't start the script #3

Closed Jaspix closed 3 years ago

Jaspix commented 3 years ago

Hello, I wanted to try the script out but I'm currently facing some issues. I made sure to follow the installation steps and installed the dependencies.

This is the output from the command line.

[front] Starting rikai-mpv... 
[rikai-mpv] Starting rikai-mpv in python...ache: 272s/150MB
Launching node.js backend...
Connecting from Python...
node:internal/errors:463
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i18next' imported from /home/andree/.config/mpv/scripts/rikai-mpv/rikaichamp-backend/extension/i18n.js
    at new NodeError (node:internal/errors:370:5)
    at packageResolve (node:internal/modules/esm/resolve:712:9)
    at moduleResolve (node:internal/modules/esm/resolve:753:18)
    at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:867:11)
    at Loader.resolve (node:internal/modules/esm/loader:89:40)
    at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
fxmarty commented 3 years ago

Thanks a lot for your interest! Could you give me your node version (with node --version)?

Jaspix commented 3 years ago

Hello. my node version is v16.5.0

fxmarty commented 3 years ago

Thank you, I can reproduce the issue. Looks like imports behave differently between v14 and v16. I will have a look.

fxmarty commented 3 years ago

Can you try the following?

1/ Delete the extension/ folder in rikaichamp-backend/ folder 2/ yarn install in rikaichamp-backend/ folder 3/ tsc in rikaichamp-backend/ folder 4/ Retry rikai-mpv with F5

Looks like node v16 doesn't like typescript compiled into javascript when it has been done when node v14 was install (though I thought tsc and nodejs were independent).

Jaspix commented 3 years ago

The issues seems resolved now! Though, I don't know what the last log means. This is the output:

[front] Starting rikai-mpv... 
[rikai-mpv] Starting rikai-mpv in python...che: 269s/150MB
Launching node.js backend...
Connecting from Python...
Checking for leftover socket.A-V:  0.000 Cache: 271s/150MB
No leftover socket found.
Creating server.
python <---> node.js socket connected.
Connection acknowledged.
node client connected.
/home/andree/.config/mpv/scripts/rikai-mpv/subtitles_popup_graphics.py:707: UserWarning: Ignore this popup showing as it is likely to fail. Please fill a bug report if this gets inconvenient. This warning won't be shown again.
  app.exec_()

Thanks a lot for your help.

fxmarty commented 3 years ago

Thank you! I will update the readme in this regard. The logging looks fine to me, as long as you manage to make use of the script :)