-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monaco Editor Stuck At Loading Screen !!! #58
Comments
Could you please provide a little bit more information? Do you use Electron? If yes, please check this discussion. |
But the problem is I don't have a public file in my config !! |
Okay, and what you have? To help you I must know the details. As I understand, you use Electron, do you use CRA? In which way are they integrated? Is there a code snippet, github (or other) repo to see the implementation? Thank you. |
I dont use CRA. |
As I am not able to reproduce it in my local machine I can guess two scenarios in which it will not work.
|
I couldn't find any solution . I have tried everything !!! |
If u can configure it for me and provide some code snippets it would be very helpful. |
I dont think it is the problem of adobe's execution environment . As it works in the dev build( only with the monaco editor webpack plugin).But does not work in the production build - Does not work even with the Monaco editor webpack plugin. Any help is highly appreciated . |
Can SomeOne Please Provide a Solution !!! |
Steps to reproduce:
Then you just end up with... |
I am not using electron |
I am using this template to build Adobe cep extensions |
If someone could help me it would be great !!! |
Hello @OwenMelbz, let me check. |
@OwenMelbz you don't need steps 5 and 6. The problem is that the library tries to download sources from CDN, which in this setup isn't allowed. Please read this discussion to see how you can download monaco from node_modules or from other local places. |
Hey, I had eventually got through that and got it working :) so an example component that works for my specific setup was... // webpack.config.js
import MonacoEditorWebpackPlugin from 'monaco-editor-webpack-plugin';
module.exports = {
// ..... blah,
plugins: [
new MonacoEditorWebpackPlugin(),
]
} // SomeComponent.js
import React from 'react';
import path from 'path';
import Editor, { monaco } from '@monaco-editor/react';
const uriFromPath = _path => {
let pathName = path.resolve(_path).replace(/\\/g, '/');
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
pathName = `/${pathName}`;
}
return encodeURI(`file://${pathName}`);
};
monaco.config({
urls: {
monacoLoader: uriFromPath(
path.join(__dirname, '../node_modules/monaco-editor/min/vs/loader.js')
),
monacoBase: uriFromPath(
path.join(__dirname, '../node_modules/monaco-editor/min/vs')
)
}
});
export default () => <Editor width="100%" height="500px" language="javascript" value="const hello ='world';" /> |
That's great, but please try without |
Can u plzz help me out aswell |
I Tried the above method just now. Still Does Not Work !!! |
Unfortunately, I am not able to do it. As I've already mentioned you have a special setup, and to be able to reproduce your case I have to have adobe photoshop installed on my machine (which is a paid software). |
I am not using it for photoshop. I am using that template for making an after effects extension |
I got it working yahoo!!!! . What i did was that i put the url like this : |
It does not show the loading thing now. |
why electron can not use CDN mode |
personally i am facing this problem on next js project check here i solve this code with 1 configuration where i findconst MonacoEditor = dynamic(() => import('@monaco-editor/react'), { ssr: false }); // usage
now it's work fine |
No description provided.
The text was updated successfully, but these errors were encountered: