suren-atoyan / monaco-loader

The utility to easy setup monaco-editor into your browser
MIT License
177 stars 37 forks source link

it works OK in dev env but failed in production env #48

Open ShenJet opened 1 month ago

ShenJet commented 1 month ago

it works OK in dev env but failed in production env.

env: angular 14 @monaco-editor/loader ^1.4.0 monaco-editor ^0.50.0

main code: import loader from '@monaco-editor/loader';

console.log(loader) // ok console.log(loader.init) // ok

loader.init().then((monaco: any) => { // it does not run from here in PRODUCTION ENV // and there was no any error happened in console console.log('loader.init.then...'); console.log(monaco); this.monacomain = monaco console.log(this.monacomain,'--this.monacomain'); // ... })

suren-atoyan commented 1 month ago

It may be a CDN issue or CSP issue - please check these. If fix CDN issue try to load it from a different source (please check this) or use it as an npm package