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

[Question] Compiler wasm fail #97

Closed
OhBonsai opened this issue Apr 24, 2021 · 5 comments
Closed

[Question] Compiler wasm fail #97

OhBonsai opened this issue Apr 24, 2021 · 5 comments

Comments

@OhBonsai
Copy link

OhBonsai commented Apr 24, 2021

Hi: @asny Thanks for your creative work. 😄

I am reimplement triangle demo. Import three-id in cargo.toml as below

[dependencies.three-d]
version="0.6.2"
default-features = false
features = ["glutin-window", "canvas"]

and build as below

wasm-pack build --target web --out-name me --out-dir pkg

but I got error

error[E0422]: cannot find struct, variant or union type `WindowSettings` in this scope
 --> src/lib.rs:8:30
  |
8 |     let window = Window::new(WindowSettings {
  |                              ^^^^^^^^^^^^^^ not found in this scope

My code is same with example/triangle

And I can't find WindowSettting struct in crate.io doc structs 😂

Is anything I have got it wrong?

@Mikayex
Copy link
Contributor

Mikayex commented Apr 24, 2021

Hi !
You are using three-d 0.6.1 in your Cargo.toml while trying to implement the triangle example from the master branch.
WindowSettings is a relatively new struct, not available in a release yet.
That also explains why you couldn't find it in the documentation...

Either use the master in your Cargo.toml or use this triangle example

@asny
Copy link
Owner

asny commented Apr 24, 2021

You are very welcome @OhBonsai 🙂 and I can only concur with what @Mikayex said 👆 maybe I should make it more clear in the readme.

@Mikayex
Copy link
Contributor

Mikayex commented Apr 24, 2021

@asny I think the solution (but it is a bit late now) would be to only put releases in master branch and put unreleased commits in a develop branch. That way, the readme people see when landing on the project page would correspond to the lastest release.
This process can only be made in place on next release now...

@OhBonsai
Copy link
Author

@Mikayex Thank you for you solution~~. I am using submodule to ref three-d source code

[submodule "three-d"]
	path = three-d
	url = https://github.com/asny/three-d.git

@asny
Copy link
Owner

asny commented Apr 25, 2021

@Mikayex I actually had a development branch, it is still there, but then people started making pull requests to master and I didn't bother to enforce development on the development branch, I don't want to make it cumbersome for people to contribute. Anyway the problem persist if you are using the non-latest release, say 0.5 then master will have the 0.6 examples. I think one should look at crates.io if using a release (since the readme and the link to the right examples is persisted) and GitHub if using the code directly. I would write something like that in the readme but might be difficult. What do you think? Maybe I should look at what others do.

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

3 participants