Ben-Kerman / immersive

Language learning mpv script for looking up words within mpv and generating Anki cards
GNU General Public License v3.0
77 stars 1 forks source link

attempt to call field 'unpack' (a nil value) #6

Closed miguelcobain closed 3 years ago

miguelcobain commented 3 years ago

I'm trying to use mpv on MacOS 10.13.6, and I get the following error:

$ mpv myfile.mkv
[immersive] Opened config file script-opts/immersive.conf. 
[immersive] 
[immersive] stack traceback:
[immersive]     ...guel/.config/mpv/scripts/immersive/utility/utf_8.lua:104: in function <...guel/.config/mpv/scripts/immersive/utility/utf_8.lua:97>
[immersive]     (tail call): ?
[immersive]     ...uel/.config/mpv/scripts/immersive/systems/config.lua:95: in function <...uel/.config/mpv/scripts/immersive/systems/config.lua:59>
[immersive]     (tail call): ?
[immersive]     ...miguel/.config/mpv/scripts/immersive/systems/ssa.lua:143: in function <...miguel/.config/mpv/scripts/immersive/systems/ssa.lua:141>
[immersive]     ...miguel/.config/mpv/scripts/immersive/systems/ssa.lua:163: in main chunk
[immersive]     [C]: in function 'require'
[immersive]     ...ig/mpv/scripts/immersive/interface/basic_overlay.lua:3: in main chunk
[immersive]     [C]: in function 'require'
[immersive]     .../miguel/.config/mpv/scripts/immersive/dict/dicts.lua:3: in main chunk
[immersive]     [C]: in function 'require'
[immersive]     ...pv/scripts/immersive/interface/definition_select.lua:4: in main chunk
[immersive]     [C]: in function 'require'
[immersive]     ...pv/scripts/immersive/interface/active_sub_lookup.lua:4: in main chunk
[immersive]     [C]: in function 'require'
[immersive]     [string "/Users/miguel/.config/mpv/scripts/immersive..."]:15: in main chunk
[immersive]     [C]: ?
[immersive]     [C]: ?
[immersive] Lua error: ...guel/.config/mpv/scripts/immersive/utility/utf_8.lua:104: attempt to call field 'unpack' (a nil value)

immersive-targets.conf:

# this line is here so the file is encoded as UTF−8
# do not delete it unless you know what that means

[target name]
# Anki profile the target will use
# Can be taken from the window title of the main Anki window or from the profile
# menu (Ctrl+Shift+P in Anki)
profile=Miguel

# Anki deck the target will use
# Subdecks use the same syntax as in Anki itself
# e.g. Root::Subdeck::Subsubdeck
deck=Root::日本語::Immersion

# note type the target will use
note_type=Migaku Japanese Sentence

# --------------------

# example field definitions

# uncomment (remove the #) and change so they fit your note type
# Anki field names go between 'field:' and '=', exactly as they are
# in Anki, including spaces.
# Template variables come after the '=', like in the examples.

field:Sentence={{sentences}}
field:Definitions={{definitions}}
field:Target Word={{word}}
field:Sentence Audio={{audio}}
field:Word Audio={{word_audio}}
field:Image={{image}}

immersive-dictionaries.conf:

# this line is here so the file is encoded as UTF−8
# do not delete it unless you know what that means

# example dictionary config for JMdict

[JMdict]
location=/Users/miguel/.config/mpv/dictionaries/jmdict_english
type=yomichan
Ben-Kerman commented 3 years ago

Your version of Lua doesn't support the standard library function table.unpack. You need either LuaJIT (5.1) with 5.2 compatibility enabled (like the Windows builds), or regular Lua 5.2

Which mpv build are you using?

miguelcobain commented 3 years ago

Seems like the latest commit https://github.com/Ben-Kerman/immersive/commit/d421166136935d7188de00c10dc748d07b4a4c8e solved it for me. Thanks.