Skip to content

Commit e6d0156

Browse files
committed
Possible fix to monaco loader trying to load from CDN rather than a local build.
1 parent 08397d0 commit e6d0156

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

mystbin/frontend/components/MonacoEditor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
import loader from '@monaco-editor/loader';
12
import {
23
monaco,
34
ControlledEditor,
45
ControlledEditorOnChange,
56
} from "@monaco-editor/react";
67
import { PropsWithoutRef } from "react";
78

8-
monaco.init().then((monaco) => {
9+
10+
loader.config({ monaco })
11+
12+
loader.init().then((monaco) => {
913
// MystBin Dark
1014
monaco.editor.defineTheme("mystBinDark", {
1115
base: "vs-dark",

mystbin/frontend/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@emotion/react": "^11.10.4",
1414
"@emotion/styled": "^11.10.4",
15+
"@fortawesome/fontawesome-svg-core": "^6.2.0",
1516
"@material-ui/core": "^4.11.0",
1617
"@material-ui/icons": "^4.9.1",
1718
"@material-ui/x-grid": "^4.0.0-alpha.37",
@@ -31,6 +32,8 @@
3132
"flux": "^4.0.1",
3233
"http-proxy": "^1.18.1",
3334
"install": "^0.13.0",
35+
"monaco-editor": "^0.34.0",
36+
"monaco-editor-webpack-plugin": "^7.0.1",
3437
"mui-datatables": "^4.2.2",
3538
"next": "^11.0.0",
3639
"react": "17.0.1",

mystbin/frontend/yarn.lock

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,18 @@
333333
minimatch "^3.0.4"
334334
strip-json-comments "^3.1.1"
335335

336+
"@fortawesome/[email protected]":
337+
version "6.2.0"
338+
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.2.0.tgz#76467a94aa888aeb22aafa43eb6ff889df3a5a7f"
339+
integrity sha512-rBevIsj2nclStJ7AxTdfsa3ovHb1H+qApwrxcTVo+NNdeJiB9V75hsKfrkG5AwNcRUNxrPPiScGYCNmLMoh8pg==
340+
341+
"@fortawesome/fontawesome-svg-core@^6.2.0":
342+
version "6.2.0"
343+
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.2.0.tgz#11856eaf4dd1d865c442ddea1eed8ee855186ba2"
344+
integrity sha512-Cf2mAAeMWFMzpLC7Y9H1I4o3wEU+XovVJhTiNG8ZNgSQj53yl7OCJaS80K4YjrABWZzbAHVaoHE1dVJ27AAYXw==
345+
dependencies:
346+
"@fortawesome/fontawesome-common-types" "6.2.0"
347+
336348
337349
version "5.0.2"
338350
resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.2.tgz#ab7043b037e68b722f93f376afb05e85c0699523"
@@ -2738,6 +2750,15 @@ loader-utils@^2.0.0:
27382750
emojis-list "^3.0.0"
27392751
json5 "^2.1.2"
27402752

2753+
loader-utils@^2.0.2:
2754+
version "2.0.2"
2755+
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
2756+
integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
2757+
dependencies:
2758+
big.js "^5.2.2"
2759+
emojis-list "^3.0.0"
2760+
json5 "^2.1.2"
2761+
27412762
locate-path@^5.0.0:
27422763
version "5.0.0"
27432764
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
@@ -2896,6 +2917,18 @@ mkdirp@^0.5.0:
28962917
dependencies:
28972918
minimist "^1.2.5"
28982919

2920+
monaco-editor-webpack-plugin@^7.0.1:
2921+
version "7.0.1"
2922+
resolved "https://registry.yarnpkg.com/monaco-editor-webpack-plugin/-/monaco-editor-webpack-plugin-7.0.1.tgz#ba19c60aba990184e36ad8722b1ed6a564527c7c"
2923+
integrity sha512-M8qIqizltrPlIbrb73cZdTWfU9sIsUVFvAZkL3KGjAHmVWEJ0hZKa/uad14JuOckc0GwnCaoGHvMoYtJjVyCzw==
2924+
dependencies:
2925+
loader-utils "^2.0.2"
2926+
2927+
monaco-editor@^0.34.0:
2928+
version "0.34.0"
2929+
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.34.0.tgz#b1749870a1f795dbfc4dc03d8e9b646ddcbeefa7"
2930+
integrity sha512-VF+S5zG8wxfinLKLrWcl4WUizMx+LeJrG4PM/M78OhcwocpV0jiyhX/pG6Q9jIOhrb/ckYi6nHnaR5OojlOZCQ==
2931+
28992932
29002933
version "2.0.0"
29012934
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"

0 commit comments

Comments
 (0)