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

Critical dependency warning, hot reload not working #850

Closed
darkhightech opened this issue Apr 26, 2018 · 2 comments
Closed

Critical dependency warning, hot reload not working #850

darkhightech opened this issue Apr 26, 2018 · 2 comments
Labels
help wanted Issues identified as good community contribution opportunities *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@darkhightech
Copy link

monaco-editor version: 0.12.0
Browser: Chrome
OS: Windows
Steps or JS usage snippet reproducing the issue:

  1. Integrated monaco via ESM package by following the steps outlined in option 2 of: https://github.com/Microsoft/monaco-editor/blob/master/docs/integrate-esm.md
  2. After loading the browser, I see the following warning. Looks like I am also not able to hot reload in the browser as well:
[HMR] bundle has 1 warnings
client.js:189 ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js
378:12-387:17 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js
 @ ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js
@alexdima
Copy link
Member

I don't know a lot about hot reloading and what could break that. I see the warning too when I execute webpack. But that is handled by creating those multiple entry points and loading works correctly for me (e.g. https://github.com/Microsoft/monaco-editor-samples/tree/master/browser-esm-webpack):

All those *.worker can be loaded at that location. Their names are dynamic because you get to choose the names.

entry: {
    "app": './index.js',
    // Package each language's worker and give these filenames in `getWorkerUrl`
    "editor.worker": 'monaco-editor/esm/vs/editor/editor.worker.js',
    "json.worker": 'monaco-editor/esm/vs/language/json/json.worker',
    "css.worker": 'monaco-editor/esm/vs/language/css/css.worker',
    "html.worker": 'monaco-editor/esm/vs/language/html/html.worker',
    "ts.worker": 'monaco-editor/esm/vs/language/typescript/ts.worker',
  },

@alexdima alexdima added webpack help wanted Issues identified as good community contribution opportunities labels Apr 27, 2018
@flash-me
Copy link

flash-me commented May 22, 2018

Hi,
I also had the same issue and posted already a solutions here

new webpack.ContextReplacementPlugin(
	/monaco-editor(\\|\/)esm(\\|\/)vs(\\|\/)editor(\\|\/)common(\\|\/)services/,
	__dirname
)

Still suspecting winjs.base.js for it. 😤 Anyway, hope I could help!

@alexdima alexdima added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 12, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Issues identified as good community contribution opportunities *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

3 participants