// WARNING: Importing @monaco-editor/react together with StripoEditor
// triggers a runtime AMD loader conflict, causing this error:
// "Uncaught Error: Can only have one anonymous define call per script file"
//
// Explanation:
// - Stripo ships its own RequireJS/Almond loader (loader.js) which defines
// window.define for AMD modules.
// - @monaco-editor/react by default loads Monaco via its AMD loader (vs/loader.js)
// which overrides window.define.
// - Having two AMD loaders on the same page causes the error above, because
// RequireJS only allows one anonymous define per script file.
//
// Stripo team: It would be ideal if Stripo could provide either:
// 1. An ESM-compatible build that does not require AMD/RequireJS at runtime, or
// 2. A way to scope their AMD loader so it does not conflict with other libraries.
//
// This would allow integration with modern ESM/React setups without runtime collisions.
import { useMonaco } from "@monaco-editor/react";
Install the dependencies:
npm installStart the dev server, and the app will be available at http://localhost:3000.
npm run devBuild the app for production:
npm run buildPreview the production build locally:
npm run previewTo learn more about Rsbuild, check out the following resources:
- Rsbuild documentation - explore Rsbuild features and APIs.
- Rsbuild GitHub repository - your feedback and contributions are welcome!