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

Failed to run example #34

Open
oovm opened this issue Feb 14, 2023 · 2 comments
Open

Failed to run example #34

oovm opened this issue Feb 14, 2023 · 2 comments

Comments

@oovm
Copy link

oovm commented Feb 14, 2023

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"] }
@TFILIPS
Copy link

TFILIPS commented Feb 26, 2023

For me it only works when I clone this repo. If I install it with cargo, then I get the same errors.

@van-sprundel
Copy link

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"] }

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

4 participants
@oovm @van-sprundel @TFILIPS and others