Skip to content
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

[Bug] Can't automatic init webworker #4487

Open
2 tasks done
JingHai-Lingyun opened this issue Apr 29, 2024 · 0 comments
Open
2 tasks done

[Bug] Can't automatic init webworker #4487

JingHai-Lingyun opened this issue Apr 29, 2024 · 0 comments

Comments

@JingHai-Lingyun
Copy link

JingHai-Lingyun commented Apr 29, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

Not applicable

Monaco Editor Playground Code

Not applicable

Reproduction Steps

  1. init a vue project (using npm create vue)
  2. intall monaco editor (using npm install [email protected])
  3. define a new theme, like:
monaco.editor.defineTheme("logThemeDark", {
        base: "vs-dark",
        inherit: true,
        rules: [],
        colors: {
            "editor.background": "#282C34",
            "editor.lineHighlightBackground": "#2C313C",
        },
    });
  1. init editor to a dom
  2. run server and open website
  3. check console in DevTools

Actual (Problematic) Behavior

warning in console:

  • chunk-KNE2EGB2.js?v=0f63c2c9:39565 Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq
  • chunk-KNE2EGB2.js?v=0f63c2c9:39567 You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker

checked the faq, not opened with file:// (opened with http:// that served by vite)

(sorry for my poor english, i'm a chinese)

Expected Behavior

can create webworker successfully

Additional Context

platfrom:

  • Window 11 24H2

browser:

  • Chrome 124.0.6367.91 x64
  • Edge 124.0.2478.67 x64 stable app beta channel

npm packages:

[email protected] D:\projects\PCL-Community\PCL2-LogViewer-TE\test-monacoEdtior
├── @vitejs/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]
@JingHai-Lingyun JingHai-Lingyun changed the title [Bug] Cant automatic init webworker [Bug] Can't automatic init webworker Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant