Although I don't mark this PR as a bugfix one, it still fixes the "Unexpected usage: loadForeignModule" error. This error is caused by monaco-editor when it cannot load the language worker. It's hard to know why the language worker cannot be loaded. It may be caused by:
Network error.
Browser's extensions.
Other software blocks access to relevant JS files (e.g., antivirus).
Corrupted installation (Steam app).
How to reproduce it:
Build the app without this PR's change.
Delete ts.worker.js.
Run nano test.js.
This problem is gone when we update monaco-editor to the latest version.
Although I don't mark this PR as a bugfix one, it still fixes the "Unexpected usage: loadForeignModule" error. This error is caused by monaco-editor when it cannot load the language worker. It's hard to know why the language worker cannot be loaded. It may be caused by:
How to reproduce it:
ts.worker.js
.nano test.js
.This problem is gone when we update
monaco-editor
to the latest version.Closes #1408.