rust-monaco
rust-monaco copied to clipboard
Failed to run example
error[E0599]: no method named `with_automatic_layout` found for struct `CodeEditorOptions` in the current scope
--> yew\src\main.rs:16:10
|
16 | .with_automatic_layout(true)
| ^^^^^^^^^^^^^^^^^^^^^ method not found in `CodeEditorOptions`
error[E0277]: the trait bound `monaco::yew::CodeEditor: yew::Component` is not satisfied
--> yew\src\main.rs:32:10
|
32 | <CodeEditor classes={"full-height"} options={ get_options().to_sys_options() } model={text_model.clone()} />
| ^^^^^^^^^^ the trait `yew::Component` is not implemented for `monaco::yew::CodeEditor`
|
= help: the trait `yew::Component` is implemented for `ContextProvider<T>`
= note: required for `monaco::yew::CodeEditor` to implement `yew::BaseComponent`
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: the function or associated item `new` exists for struct `VChild<CodeEditor>`, but its trait bounds were not satisfied
--> yew\src\main.rs:32:10
|
32 | <CodeEditor classes={"full-height"} options={ get_options().to_sys_options() } model={text_model.clone()} />
| ^^^^^^^^^^ function or associated item cannot be called on `VChild<CodeEditor>` due to unsatisfied trait bounds
|
::: github.com-1ecc6299db9ec823\monaco-0.3.0\src\yew\mod.rs:28:1
|
28 | pub struct CodeEditor {
| --------------------- doesn't satisfy `monaco::yew::CodeEditor: yew::BaseComponent`
|
= note: the following trait bounds were not satisfied:
`monaco::yew::CodeEditor: yew::BaseComponent`
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info)
with
[dependencies]
wasm-bindgen = "0.2.84"
yew = { version = "0.20.0", features = ["csr"] }
monaco = { version = "0.3.0", features = ["yew-components"] }
For me it only works when I clone this repo. If I install it with cargo, then I get the same errors.
That's because the main branch implements yew components, but the 0.4.0 release doesn't. I'm changing it to this until they release a new version:
monaco = { git = "https://github.com/siku2/rust-monaco", branch = "main", features = [ "yew-components"] }