Skip to content
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

load monaco editor into a page where require.js already exist without loading from CDN #650

Open
dinis4 opened this issue Oct 19, 2024 · 2 comments

Comments

@dinis4
Copy link

dinis4 commented Oct 19, 2024

I set my config file to avoid loading from cdn
monaco.config({ vs: { path: 'node_modules/monaco-editor/min/vs'} });

on a page require.js is already exist and at a time I load monaco-editor files I get error from require.js
error: mismatched anonymous define() modules: function { ... };

I cannot remove requirejs, as this is what the platform provides me.

@BrightTan
Copy link

I got the same problem,is says:
error: Mismatched anonymous define() modules...
when I delete window.require, it get well. I can't remove window.require too

@BrightTan
Copy link

I config like:

import * as monaco from 'monaco-editor';
import { loader } from '@monaco-editor/react';
loader.config({ monaco })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants