Skip to content

Fix temporary error when imports are used, support circular imports - #169

Merged
generalmimon merged 1 commit into
masterfrom
fix-fresh-and-circular-imports
Feb 21, 2024
Merged

generalmimon merged 1 commit into
masterfrom
fix-fresh-and-circular-imports

Conversation

@generalmimon

Copy link
Copy Markdown
Member

Fixes #59

Fixes #159 - this is a particularly notable instance of the bug, since TypeError: DosDatetime is not a constructor is an error that initially everyone gets when they open the Web IDE in a fresh browser (this is because zip.ksy is selected by default, and it is affected by the bug since it contains an import).

See kaitai-io/kaitai_struct#1074 and kaitai-io/kaitai_struct_compiler#264 - the actual fix was done in the KSC-generated JS code, which was changed to allow interdependent format modules to be loaded (and added to the global context in the case of the Web IDE) in any order. However, this was a backwards-incompatible change, so this set of Web IDE changes just updates our code to work with the new compiler.

@generalmimon

generalmimon commented Feb 15, 2024 •

Copy link
Copy Markdown
Member Author

This pull request is marked as draft until kaitai-io/kaitai_struct_compiler#264 is merged and a new version of KSC is available at https://www.npmjs.com/package/kaitai-struct-compiler?activeTab=versions. Only then the exact version of kaitai-struct-compiler will be known, so I'll have to update this PR after that.

Fixes #59

Fixes #159 -
this is a particularly notable instance of the bug, since `TypeError:
DosDatetime is not a constructor` is an error that initially everyone
gets when they open the Web IDE in a fresh browser (this is because
`zip.ksy` is selected by default, and it is affected by the bug since it
contains an import).

See kaitai-io/kaitai_struct#1074 and
kaitai-io/kaitai_struct_compiler#264 - the
actual fix was done in the KSC-generated JS code, which was changed to
allow interdependent format modules to be loaded (and added to the
global context in the case of the Web IDE) in any order. However, this
was a backwards-incompatible change, so this set of Web IDE changes just
updates our code to work with the new compiler.
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

Successfully merging this pull request may close these issues.

Empty object tree and error on opening ide with zip example Problem with imports on local storage

1 participant