-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack bundle is missing the typescript worker #837
Comments
We have several fully working examples like e.g. here: I'm sorry I cannot help you out with webpack specific questions, simply because I am not a webpack expert. I suggest to start with a sample. |
Indeed this issue is reproducible in the linked example. Tough I forgot to say you have to set the language to typescript. Try typing in the editor and errors shoud pop up. |
@lucat1 The sample works fine if you follow all the steps: |
For the Critical Dependency you can try this solution. |
this example is OK because It satisfy HTML5 Worker Same Origin Policy, But If I place webpack bundle files in CDN. Then in self.MonacoEnvironment = {
getWorkerUrl: function (moduleId, label) {
if (label === 'json') {
return __webpack_public_path__ + './json.worker.js';
}
if (label === 'css') {
return __webpack_public_path__ + './css.worker.js';
}
if (label === 'html') {
return __webpack_public_path__ + './html.worker.js';
}
if (label === 'typescript' || label === 'javascript') {
return __webpack_public_path__ + './ts.worker.js';
}
return __webpack_public_path__ + './editor.worker.js';
}
} it will cause SO HOW TO SOLVE THIS PROBLEM? |
HTML5 does not allow to launch web workers from a different domain. In this case, you would need to have some piece of code that bootstraps things either inlined as base64 or in a |
monaco-editor version: 0.12.0
Browser: Any
OS: Any
Steps or JS usage snippet reproducing the issue:
Build the ESM example with webpack that can be found here
The error reported in the Devtools is about a missing package, but I beleive it is related to this webpack warning, and so to the issue #759.
The text was updated successfully, but these errors were encountered: