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

Unable to use on CompilerExplorer/godbolt.org (Monaco Editor) #283

Closed
iamkroot opened this issue Apr 28, 2023 · 1 comment · Fixed by #315
Closed

Unable to use on CompilerExplorer/godbolt.org (Monaco Editor) #283

iamkroot opened this issue Apr 28, 2023 · 1 comment · Fixed by #315

Comments

@iamkroot
Copy link

Hello! Thanks for this cool extension!
I am unable to use GT with Compiler Explorer. It uses the Monaco editor under the hood (#239).
Upon activating GT, it does detect the textarea, and my editor (sublime) also prints some logs saying it has connected. But no file is opened inside the editor. Any idea why this would be happening?

@fregante
Copy link
Owner

Thanks for the report! It looks like the initialization is failing for some reason. On this line this.field is undefined

console.info('sending', this.field.value.length, 'characters');

and I think it's because this line throws an error in their own code:

this.el.dispatchEvent(
new CustomEvent('gt:get', {
bubbles: true,
}),
);

Screenshot

I think it's their own "Sentry" error reporter.

An easy solution would be to make that dispatchEvent call asynchronous so it doesn't affect the constructor. Or better yet wrap it in try/catch

However that isn't guarantee to fix it since it's their code that is breaking it. It might be worth contacting https://sentry.io, they might know why their code is throwing an error in a basic dispatchEvent

@fregante fregante changed the title Unable to use on CompilerExplorer (godbolt.org) Unable to use on CompilerExplorer/godbolt.org (Monaco Editor) Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants