Skip to content

Missing dompurify addHook #300

Description

@vbar

I've just checked out the latest version and am trying to run the Node.js example. When building, yarn shows quite few warnings like

WARNING in ../node_modules/monaco-editor-core/esm/vs/base/browser/markdownRenderer.js
250:4-21 "export 'addHook' (imported as 'dompurify') was not found in './dompurify/dompurify' 
@ ../node_modules/monaco-editor-core/esm/vs/base/browser/markdownRenderer.js
@ ../node_modules/monaco-editor-core/esm/vs/editor/browser/core/markdownRenderer.js
@ ../node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/parameterHintsWidget.js
@ ../node_modules/monaco-editor-core/esm/vs/editor/contrib/parameterHints/parameterHints.js
@ ../node_modules/monaco-editor-core/esm/vs/editor/editor.all.js
@ ../node_modules/monaco-editor-core/esm/vs/editor/editor.main.js
@ ./lib/main.js

That's just a warning, so I ignore it and proceed to run yarn run start and open http://localhost:3000/ .

That seems to be working - I see the Monaco Language Client Node.js Sample page, and the console has "Sample Language Client: The server is initialized." - but soon (I suppose on any further input from the backend language server) crashes:

Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_1__dompurify_dompurify__.addHook is not a function
    sanitizeRenderedMarkdown markdownRenderer.js:250
    renderMarkdown markdownRenderer.js:227
    render markdownRenderer.js:53
    renderHoverParts markdownHoverParticipant.js:122
    _renderMessages modesContentHover.js:438
    _withResult modesContentHover.js:405
    _hoverOperation modesContentHover.js:197

So it seems the warning was about something real... I see at https://githubmemory.com/repo/microsoft/monaco-editor/issues/2691 that monaco-editor recently had a suspiciously similar dependency problem - perhaps it should also be fixed in monaco-editor-core?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions