Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS HexEditor pane comes up blank #13532

Closed
Tracked by #13192
profbbrown opened this issue Mar 26, 2024 · 8 comments · Fixed by #13722
Closed
Tracked by #13192

VS HexEditor pane comes up blank #13532

profbbrown opened this issue Mar 26, 2024 · 8 comments · Fixed by #13722
Milestone

Comments

@profbbrown
Copy link

profbbrown commented Mar 26, 2024

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.

Screenshot 2024-03-22 at 1 11 59 PM

Is there anything else I need to configure for the hex editor to function properly?

Originally posted by @profbbrown in #13519

@profbbrown profbbrown changed the title MS HexEditor pane comes up blank VS HexEditor pane comes up blank Mar 26, 2024
@profbbrown
Copy link
Author

I'm using ms-vscode.hexeditor, version 1.9.14, installed from the Extensions pane.

Theia version 1.47.0, in a web browser.

@tsmaeder
Copy link
Contributor

tsmaeder commented Apr 2, 2024

This seems fixed in 1.48.0. Please let us know if it's still a problem for you.

@tsmaeder tsmaeder closed this as completed Apr 2, 2024
@JonasHelming
Copy link
Contributor

FYI, preview is avilable here: https://download.eclipse.org/theia/ide-preview/1.48.0/

@profbbrown
Copy link
Author

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.

Screenshot 2024-04-02 at 8 24 26 AM

@JonasHelming JonasHelming reopened this Apr 2, 2024
@profbbrown
Copy link
Author

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")

@tsmaeder
Copy link
Contributor

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 moreTypesto false when creating the Packr instance, the test runs through.

@tsmaeder
Copy link
Contributor

I have filed kriszyp/msgpackr#135

@tsmaeder
Copy link
Contributor

Let's wait an see how they react to the issue.

tsmaeder added a commit to tsmaeder/theia that referenced this issue May 20, 2024
Fixes eclipse-theia#13532

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
tsmaeder added a commit that referenced this issue May 27, 2024
Fixes #13532

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
@jfaltermeier jfaltermeier added this to the 1.50.0 milestone Jun 3, 2024
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 a pull request may close this issue.

4 participants