Skip to content

Issues using relative paths in kaitai templates #33

@perivar

Description

@perivar

When using binary files that include other binary files, like media/standard_midi_file.ksy which include /common/vlq_base128_be, it fails with an error like:

TypeError: Cannot convert undefined or null to object
at Function.keys ()
at $c_sjs_js_WrappedDictionary$DictionaryIterator.init___sjs_js_Dictionary (c:\Users\per.nerseth\Development\kaitai_ide_vscode\node_modules\kaitai-struct-compiler\kaitai-struct-compiler.js:38435:27)
at $c_Lio_kaitai_struct_format_JavaScriptKSYParser$.yamlJavascriptToScala__O__O (c:\Users\per.nerseth\Development\kaitai_ide_vscode\node_modules\kaitai-struct-compiler\kaitai-struct-compiler.js:7830:71)

The reason is that the compiler expects imports to be absolute paths and not relative paths.
The only fix I found was to copy the file into the same base path and import it like this:
imports:
- vlq_base128_be

Otherwise the extension seem to work fine !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions