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

Remove illegal top level export from web worker script #123739

Closed
wants to merge 1 commit into from

Conversation

NullVoxPopuli
Copy link

@NullVoxPopuli NullVoxPopuli commented May 13, 2021

#124095

This PR fixes an issue I've been having with Monaco, where loading the editor would throw an error about tap level exports not allowed.
I was less worried about this, but I recently added error tracking to my site, and figured if the fix is easy, I may as well fix it 🙃

Details:

Worker scripts presently do not allow exports
@NullVoxPopuli
Copy link
Author

@mjbvz & @alexdima anything I need to do to move this along? Thanks! <3

@alexdima alexdima self-requested a review May 31, 2021 16:01
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the ESM build of the editor.

Notice how this method is imported by other scripts e.g. https://github.com/microsoft/monaco-css/blob/f595049d3df420ce88a454f3903835a101ab1be9/src/css.worker.ts#L11

If exporting from the web worker main script is illegal, we could create a new file, e.g. editor.worker.main without any exports.

@alexdima
Copy link
Member

@alexdima alexdima closed this Nov 18, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants