Comments (14)
Oh, My bad. It needs a minor fix to the CSS plugin to work. So I can't do anything until I get my monitor back. Sorry.
from reboost.
Fixed in v0.18.2
. Update your installation of Reboost.
from reboost.
If you look at the package.json of @monaco-editor/react
you can see that prop-types
is a peerDependency
, so it means you have to manually install it. Please install it in your project using
npm i prop-types
# or
yarn add prop-types
from reboost.
thank you.
from reboost.
I don’t know what happened, I tried to solve it myself, but I don’t know how to deal with it.
from reboost.
In your template include these
<script type="module" src="{{PATH_TO_SCRIPT}}"></script>
<script nomodule src="{{PATH_TO_SCRIPT}}"></script>
Both are required. Hope it fixes the issue.
from reboost.
no effect
from reboost.
This is caused by CommonJS modules. Can you try adding this to your options
start({
// ... other options
commonJSInterop: {
mode: 1
}
})
from reboost.
from reboost.
Actually, CommonJS interoperability with ES modules is a complex thing. I guess I have to rewrite the transformer code to support it. Until then all you can do is wait.
from reboost.
It looks like the problem comes from @monaco-editor/react
. It created an import mess in its code which's why Reboost can't optimize it to work with ES Modules. I tried react-monaco-editor
and it's working fine with some configuration.
Files
reboost.js
const { start, builtInPlugins: { UsePlugin, FilePlugin } } = require('reboost'); start({ entries: [ ['./src/index.jsx', './public/dist/index.js'] ], commonJSInterop: { mode: 1 }, plugins: [ // For loading fonts UsePlugin({ include: /\.ttf/i, use: FilePlugin() }) ], })
src/index.js
import React from "react"; import ReactDOM from "react-dom"; import MonacoEditor from "react-monaco-editor"; const App = () => <MonacoEditor height="90vh" language="javascript" />; const monacoElement = document.getElementById("monaco"); ReactDOM.render(<App />, monacoElement);
So you can just use react-monaco-editor
instead of @monaco-editor/react
. There's no other way to fix this in Reboost.
from reboost.
I adjusted it according to your code and tested it, but it still doesn't work. Can you add an example to the playground?
from reboost.
from reboost.
if enable commonJSInterop mode:1
from reboost.
Related Issues (20)
- PostCSSPlugin - How to pass the "path" of PostCSS Config Directory HOT 4
- Moving "jsconfig.json" from project root in "Lit-Element" template HOT 1
- "lit-element" stopped getting rendered HOT 6
- esbuild and Babel HOT 5
- "plugin-babel - transformContent" mismatch type declaration HOT 2
- How to pass a plugin config object to the plugin itself during bootstrap HOT 2
- PostCSSPlugin - error not caught HOT 10
- Contradiction and confusion HOT 1
- Unable to resolve path aliases HOT 2
- Unable to import css files HOT 12
- Page not reloaded when css file changes HOT 2
- "includeDefaultPlugins" config option HOT 1
- Does it support route? HOT 10
- I feel that reboost should be a robust HMR server. HOT 1
- tailwindcss not work HOT 11
- Identifier '__Runtime' has already been declared. (ReactRefreshPlugin) HOT 9
- Serving/opening more than one html files at the same time HOT 1
- plugin-litcss upgrade HOT 2
- Error while importing awaitable-timers HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reboost.