suren-atoyan / monaco-react

Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins
https://monaco-react.surenatoyan.com/
MIT License
3.81k stars 268 forks source link

"ENOENT: no such file or directory, open" Error #527

Open croxydev opened 1 year ago

croxydev commented 1 year ago

Hello. When i use <Editor> tag it gives me this error: Error: ENOENT: no such file or directory, open 'C:\Users\Burak\Desktop\Klasörler\Yazılım\croxy-code-editor\https:\cdn.jsdelivr.net\npm\monaco-editor@0.36.1\min\vs\editor\editor.main.js'

I didn't used any process.cwd() or something. How can i fix this?

import React, { useRef, useEffect } from 'react';
import Head from 'next/head';
import Link from 'next/link';
import { ipcRenderer } from "electron";
import Editor, { useMonaco } from '@monaco-editor/react';

function Main() {
  const monaco = useMonaco();

  useEffect(() => {
    if (monaco) {
      console.log('here is the monaco instance:', monaco);
    }
  }, [monaco]);
  return (
        <div className="bg-white marker:shadow-lg h-full flex flex-col text-sm select-none">
            <main className="bg-dark-700 overflow-y-auto w-full h-full">
              <div className="main-content flex flex-col flex-grow mt-4">
                <div className="flex flex-col flex-grow bg-dark-600 rounded mt-2">
                <div>
                  <Editor height="90vh" defaultValue="// some comment" defaultLanguage="javascript" />;
                </div>
                </div>
              </div>
            </main>
        </div>
  );
}

export default Main;

I'm using these modules: "next": "^12.3.4", "nextron": "^8.5.0", "react": "^18.2.0", "@monaco-editor/react": "^4.5.2", "electron-serve": "^1.1.0", "electron-store": "^8.1.0", "monaco-editor": "^0.41.0", "monaco-editor-electron": "^1.0.6" "electron": "^21.3.3",

suren-atoyan commented 1 year ago

hi @croxywastaken 👋

could you please check this section?