materiahq / ngx-monaco-editor

Monaco Editor Library for Angular v6 and above
MIT License
159 stars 35 forks source link

Not works in electron #38

Closed noririco closed 3 years ago

noririco commented 3 years ago

Hi I try to load the editor with local path (default or explicit) in ELECTRON but it wont work. any idea ?

Using this setup

 "assets": [
         ....
        { "glob": "**/*", "input": "node_modules/monaco-editor", "output": "assets/monaco-editor/" }
  ],

CDN WORKS IN BROWSER WORKS IN ELECTRON

    ....
    MonacoEditorModule,
    ...
  ],
  providers: [
    {
       provide: MONACO_PATH,
       useValue: 'https://unpkg.com/monaco-editor@0.18.1/min/vs'
     }
  ],

loader.js LOAD editor.main.js LOAD editor.main.css LOAD editor.main.nls.js LOAD workerMain.js LOAD

LOCAL WORKS IN BROWSER NOT WORK IN ELECTRON

    ....
    MonacoEditorModule,
    ...
  ],
  providers: [],

loader.js LOAD editor.main.js NOT LOAD editor.main.css NOT LOAD editor.main.nls.js NOT LOAD workerMain.js NOT LOAD

package.json

@angular/animations": "^8.2.14",
    "@angular/cdk": "^8.2.3",
    "@angular/cdk-experimental": "^8.2.3",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@materia-ui/ngx-monaco-editor": "^4.0.2",
    ...
    "monaco-editor": "^0.21.2",
    ...
noririco commented 3 years ago

After some more digging I found https://github.com/materiahq/ngx-monaco-editor/issues/19 It seems that monaco-editor version > 0.18.1 wont work with angular8.

jmarc-roy commented 3 years ago

Hi @noririco,

Yes you are correct about angular/monaco version compatibility. I will update the README.MD to add this information easily available.

Do you still have an issue on this after downgrading your monaco-editor version ?

nikhilnxvverma1 commented 3 years ago

I can confirm that when I downgraded from 0.21.2 down to 0.18.1, it worked. Thanks for the comment above.

noririco commented 3 years ago

Hi @noririco,

Yes you are correct about angular/monaco version compatibility. I will update the README.MD to add this information easily available.

Do you still have an issue on this after downgrading your monaco-editor version ?

Works like a charm.