microsoft/monaco-editor-webpack-plugin

Cannot find module 'monaco-editor\esm\vs\editor\contrib\gotoSymbol\goToCommands'

Croller opened this issue ยท 13 comments

image

current version 1.7.0, after update to 1.8.1 i get error
using vue js

me too!I'm have one question

Me too!

Me too...

I also encountered this trouble!
I have try use typescript 3.7.4 -> 3.7.2
is work!

Same problem. I use JS not Typescript.
Any workaround?

I have the same problem

(node:66735) UnhandledPromiseRejectionWarning:   Error: Cannot find module 'monaco-editor/esm/vs/editor/contrib/gotoSymbol/goToCommands'
  
  - loader.js:581 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:581:15
  
  - helpers.js:32 Function.resolve
    internal/modules/cjs/helpers.js:32:19
  
  - index.js:26 resolveMonacoPath
    [backoffice-vue]/[monaco-editor-webpack-plugin]/out/index.js:26:20
  
  - index.js:161 use.options.pre.featurePaths.map
    [backoffice-vue]/[monaco-editor-webpack-plugin]/out/index.js:161:63
  
  - Array.map
  
  - index.js:161 createLoaderRules
    [backoffice-vue]/[monaco-editor-webpack-plugin]/out/index.js:161:43
  
  - index.js:80 MonacoEditorWebpackPlugin.apply
    [backoffice-vue]/[monaco-editor-webpack-plugin]/out/index.js:80:23
  
  - webpack.js:51 webpack
    [backoffice-vue]/[webpack]/lib/webpack.js:51:13
  
  - dev-server.js:30 DevServer.listenCSR
    [backoffice-vue]/[@quasar]/app/lib/dev-server.js:30:22
  
  - dev-server.js:25 resolve
    [backoffice-vue]/[@quasar]/app/lib/dev-server.js:25:16
  
  - new Promise
  
  - dev-server.js:22 DevServer.listen
    [backoffice-vue]/[@quasar]/app/lib/dev-server.js:22:12
  
  - quasar-dev:265 Promise.resolve.then.then.then.then
    [backoffice-vue]/[@quasar]/app/bin/quasar-dev:265:29
  
  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7
  
  - loader.js:745 Function.Module.runMain
    internal/modules/cjs/loader.js:745:11
  
  - node.js:283 startup
    internal/bootstrap/node.js:283:19

Excluding gotoSymbol in the config like this: features: ['!gotoSymbol'] should help

Which config file ? Can you please be more specific ?

monaco-editor-webpack-plugin at 1.8.1 can be used to load monaco-editor at ^0.19.0. This is expressed in the peer dependency --

"monaco-editor": "^0.19.0"

It cannot load older versions of the monaco-editor, the reason being that the editor changes its internal shape across versions.

If you want to load older versions of the monaco-editor, you need to use older versions of the monaco-editor-webpack-plugin.

ef4 commented

Please consider doing a semver major release the next time you make this kind of change.

I understand that the peerDep correctly declares what you need, but realize that the NPM ecosystem's support for peerDeps is... bad. So people are going to file bugs like this all the time.

It's cheap and easy to pick 2.0.1 instead 1.8.1, and then this will come up less.

@ef4 You are correct, apologies for that.

Excluding gotoSymbol in the config like this: features: ['!gotoSymbol'] should help

It worked for me. Thanks!

Which config file ? Can you please be more specific ?

webpack.config.js

    new MonacoWebpackPlugin({
      features: ['!gotoSymbol'],
    }),