Skip to content

[Bug] packaged into components by lib ,Unexpected usage at yc.loadForeignModule #4029

Answered by ananzhusen
ananzhusen asked this question in Q&A
Discussion options

You must be logged in to vote

solve
Add the following code to the index.html file:

<script>self["MonacoEnvironment"] = (function (paths) { return { globalAPI: false, getWorkerUrl : function (moduleId, label) { var result = paths[label]; if (/^((http:)|(https:)|(file:)|(\/\/))/.test(result)) { var currentUrl = String(window.location); var currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length); if (result.substring(0, currentOrigin.length) !== currentOrigin) { var js = '/*' + label + '*/importScripts("' + result + '");'; var blob = new Blob([js], { type: 'application/javascript' }); return URL.createObjectURL(blob); } } retu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@water5656
Comment options

Answer selected by hediet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4026 on June 16, 2023 14:33.