theia
theia copied to clipboard
VS HexEditor pane comes up blank
I've installed the VS Hex Editor extension using the Extensions manager. Whenever I try to open a file using it, the pane is empty. It's using a webview, which from experience causes problems for some Theia installations. But webview works fine for things like image viewing. (I've had to set the webview endpoint to {{hostname}}
in order to get it to work.)
Attached is a screenshot of the two errors that appear in the JavaScript console.
Is there anything else I need to configure for the hex editor to function properly?
Originally posted by @profbbrown in https://github.com/eclipse-theia/theia/discussions/13519
I'm using ms-vscode.hexeditor, version 1.9.14, installed from the Extensions pane.
Theia version 1.47.0, in a web browser.
This seems fixed in 1.48.0. Please let us know if it's still a problem for you.
FYI, preview is avilable here: https://download.eclipse.org/theia/ide-preview/1.48.0/
The Hex Editor is now appearing in the pane. That part is fixed.
However, the contents of the pane is just "LOADING".
There is a JavaScript error: root ERROR Error: Could not find typed array for code 16
. I'll need to build a developer version of Theia to get you a proper file and line number.
My development build still has obfuscated variable names and a single bundle.js. However, some searching around came up with a pretty good match on this: https://greasyfork.org/en/scripts/457386-scenexeutils/code
(Do a search within the page for "could not find typed array for code")
It seems the remaining problem is related to how msgpackr
treats array buffers. Consider this script:
const { Packr } = require ('msgpackr');
const inst= new Packr({ moreTypes: true, encodeUndefinedAsNil: false, bundleStrings: false });
const value = {
type: 16,
value: new ArrayBuffer(10)
};
const serializedAsBuffer = inst.encode(value);
const data = inst.decode(serializedAsBuffer);
console.log(`object is ${JSON.stringify(data)}`);
The script fails with the same error I get from the hex editor.
Error: Could not find typed array for code 16
at currentExtensions.<computed> (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:1056:9)
at readExt (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:892:33)
at read (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:339:12)
at Array.readObject [as read] (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:522:18)
at recordDefinition (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:992:19)
at read (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:418:13)
at checkedRead (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:197:13)
at Packr.unpack (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:107:12)
at Packr.decode (C:\Users\thomas\code\EclipseSource\theia\node_modules\msgpackr\dist\node.cjs:179:15)
at Object.<anonymous> (C:\Users\thomas\code\EclipseSource\theia\scripts\testpack.js:11:19)
When I flip the flags moreTypes
to false
when creating the Packr
instance, the test runs through.
I have filed https://github.com/kriszyp/msgpackr/issues/135
Let's wait an see how they react to the issue.