Skip to content

Fix load order for 'screenshot-tool' - #11778

Merged
Joey Wunderlich (jwunderl) merged 3 commits into
masterfrom
fix-screenshot-tool
Dec 3, 2026
Merged

Joey Wunderlich (jwunderl) merged 3 commits into
masterfrom
fix-screenshot-tool

Conversation

@ganicke

@ganicke Galen Nickel (ganicke) commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Looks like the Screenshot tool is broken. It seems that Monaco updated its load structure?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The worker’s baseUrl incorrectly points to the vs directory, producing min/vs/vs/... module URLs that prevent the JavaScript language worker from loading.

1 open issue
What changed in this PR

This PR updates Monaco initialization in the MakeCode block screenshot tool, aiming to restore the editor by loading its dependencies in the correct order.

Changes:

  • Loads Monaco through its AMD loader before starting the screenshot tool script.
  • Adds a worker bootstrap for Monaco assets hosted on another origin.
  • Reformats the HTML without changing the page layout.
File Description
docs/​screenshot-tool.html Updates Monaco load order and worker configuration; reformats the markup.

Review effort: Max

Comment thread docs/screenshot-tool.html Outdated
window.MonacoEnvironment = {
getWorkerUrl: function () {
return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
self.MonacoEnvironment = { baseUrl: '${vsBase}/' };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Turns out this doesn’t get used: editor.main replaces MonacoEnvironment with its own worker, and the old workerMain.js path doesn’t exist in the hosted Monaco build, so I removed it; workers still load from vs/assets

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍

@Jaqster

Copy link
Copy Markdown
Member

Related issue: #10873

@jwunderl
Joey Wunderlich (jwunderl) added this pull request to the merge queue Dec 3, 2026
Merged via the queue into master with commit d613487 Dec 3, 2026
20 checks passed
@jwunderl
Joey Wunderlich (jwunderl) deleted the fix-screenshot-tool branch December 3, 2026 19:09
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.

4 participants