suren-atoyan / monaco-loader

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

Monaco editor not working in Egypt Region [CDN issue] #34

Closed rameshpvr closed 3 months ago

rameshpvr commented 1 year ago

I have built a web application using the Monaco Editor. One of my clients from the Egypt region encountered an issue when trying to use the Monaco Editor Playground in my application. After debugging, I discovered the root cause of the issue. The problem is that the Monaco Editor relies on the jsdelivr CDN provider to retrieve necessary resources. However, my client is currently unable to access it.

Can you suggest a solution or an alternative approach to tackle this problem?

Instead of fetching the resources from the CDN, we can consider loading them from the "node_modules" directory after installing the Monaco Editor package.

API Failed Information:

Request: https://cdn.jsdelivr.net/npm/monaco-editor@0.36.1/min/vs/loader.js Response: Failed to load response data. No data found for the resource with the given identifier

rameshpvr commented 1 year ago

I have raised an issue with jsdelivr. You can find more information about it at the following link: jsdelivr/jsdelivr#18505.

rameshpvr commented 1 year ago

@suren-atoyan

suren-atoyan commented 1 year ago

@rameshpvr you can use config and load source code from other destinations like cdnjs


import loader from '@monaco-editor/loader';

// you can change the source of the monaco files
loader.config({ paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.39.0/min/vs' } });