Monaco-editor: Error: Unexpected usage (integration with vue)

Created on 21 Mar 2019  路  7Comments  路  Source: microsoft/monaco-editor

languageFeatures.js?810d:85 Error: Unexpected usage
at EditorSimpleWorkerImpl.BaseEditorSimpleWorker.loadForeignModule (editorSimpleWorker.js?8c76:468)
at eval (webWorker.js?a9b4:39)

integration needs-more-info

Most helpful comment

My solution: Configure webpack-plugin in vue.config.js, instead of webpack.config.js:

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
  configureWebpack: {
   plugins: [
      new MonacoWebpackPlugin({
        // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
        languages: ['javascript', 'css', 'html', 'typescript', 'json']
      })
    ]
  }

All 7 comments

Looking for a solution...

My solution: Configure webpack-plugin in vue.config.js, instead of webpack.config.js:

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
  configureWebpack: {
   plugins: [
      new MonacoWebpackPlugin({
        // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
        languages: ['javascript', 'css', 'html', 'typescript', 'json']
      })
    ]
  }

same issue here when treating with json

@soneway Have you resolved your issue?

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

Can this be reopened please?

@Symbolk do you understand why making that changed fixed anything?

My solution: Configure webpack-plugin in vue.config.js, instead of webpack.config.js:

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
  configureWebpack: {
   plugins: [
      new MonacoWebpackPlugin({
        // available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
        languages: ['javascript', 'css', 'html', 'typescript', 'json']
      })
    ]
  }

when i use this solution 锛宻ee https://github.com/microsoft/monaco-editor-webpack-plugin/issues/96

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inf9144 picture inf9144  路  3Comments

Kang-Jun-sik picture Kang-Jun-sik  路  3Comments

fabiospampinato picture fabiospampinato  路  3Comments

chengtie picture chengtie  路  3Comments

aarinsmith picture aarinsmith  路  3Comments