Skip to content

Commit 22986da

Browse files
authored
Merge pull request #84 from MOV-AI/Manuel-RPC-2926-clear-console-errors
FP-2926: Fixed a couple of console errors
2 parents fd4ba97 + d552682 commit 22986da

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# TBD
22

3+
- [FP-2926](https://movai.atlassian.net/browse/FP-2926): Clear console and app errors
34
- [QAP-3964](https://movai.atlassian.net/browse/QAP-3964): Review devcontainer configuration for lib-code
45
- [FP-2840](https://movai.atlassian.net/browse/FP-2840): Update ReadMe's on all apps
56
- [FP-2851](https://movai.atlassian.net/browse/FP-2851): Added new unit tests to repo

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"@codingame/monaco-languageclient": "^0.17.3",
103103
"@mov-ai/mov-fe-lib-core": "^1.2.2-1",
104104
"@mov-ai/mov-fe-lib-react": "^1.3.4-1",
105+
"monaco-editor": "^0.31.1",
105106
"react": "^18.2.0",
106107
"react-dom": "^18.2.0"
107108
},

src/components/MonacoCodeEditor/MonacoCodeEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ MonacoCodeEditor.propTypes = {
175175
value: PropTypes.string,
176176
style: PropTypes.object,
177177
useLanguageServer: PropTypes.bool,
178-
builtins: PropTypes.object,
178+
builtins: PropTypes.array,
179179
};
180180

181181
MonacoCodeEditor.defaultProps = {

src/components/MonacoCodeEditor/hooks/useMonacoEditorCore.js

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,29 @@ import ReconnectingWebSocket from "reconnecting-websocket";
1818
* */
1919
//========================================================================================
2020

21-
self.MonacoEnvironment = {
22-
getWorkerUrl: function (_, label) {
23-
if (label === "json") {
24-
return "./json.worker.bundle.js";
25-
}
26-
if (label === "css" || label === "scss" || label === "less") {
27-
return "./css.worker.bundle.js";
28-
}
29-
if (label === "html" || label === "handlebars" || label === "razor") {
30-
return "./html.worker.bundle.js";
31-
}
32-
if (label === "typescript" || label === "javascript") {
33-
return "./ts.worker.bundle.js";
34-
}
35-
return "./editor.worker.bundle.js";
36-
},
37-
};
21+
// Commented this because it was throwing an error as something
22+
// In the bundler (spent a few hours investigating this)
23+
// wasn't working. Since I couldn't get the files by any name /
24+
// path, ended up giving up and just commented this. Now we
25+
// only get a simple warning in the console instead of that
26+
// invasive backdrop error and console error.
27+
// self.MonacoEnvironment = {
28+
// getWorkerUrl: function (_, label) {
29+
// if (label === "json") {
30+
// return "./json.worker.js";
31+
// }
32+
// if (label === "css" || label === "scss" || label === "less") {
33+
// return "./css.worker.js";
34+
// }
35+
// if (label === "html" || label === "handlebars" || label === "razor") {
36+
// return "./html.worker.js";
37+
// }
38+
// if (label === "typescript" || label === "javascript") {
39+
// return "./ts.worker.js";
40+
// }
41+
// return "./editor.worker.js";
42+
// },
43+
// };
3844

3945
const createUrl = () => {
4046
const protocol = location.protocol === "https:" ? "wss" : "ws";

0 commit comments

Comments
 (0)