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

Cannot find type Vec in scope when compiling web-sys-0.3.76/src/features/gen_ImageData.rs:35:62 #4406

Closed
wdanilo opened this issue Jan 14, 2025 · 1 comment
Labels

Comments

@wdanilo
Copy link
Contributor

wdanilo commented Jan 14, 2025

Describe the Bug

I'm using web-sys 0.3.76 with features features = ["CssStyleDeclaration", "ResizeObserver", "ResizeObserverEntry", "DomRectReadOnly", "HtmlDivElement", "console", "MouseEvent", "WheelEvent", "KeyboardEvent", "AddEventListenerOptions", "DomRect", "CanvasRenderingContext2d", "ImageData"]. The project compiles fine when using wasm-pack, but when I try to use cargo clippy I got error:

error[E0412]: cannot find type `Vec` in this scope
  --> <edited>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/web-sys-0.3.76/src/features/gen_ImageData.rs:35:62
   |
35 |     pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped<Vec<u8>>;
   |                                                              ^^^ not found in this scope
   |
help: consider importing this struct
   |
3  + use alloc::vec::Vec;
   |

Expected Behavior

This error should never happen, as it basically means that this library cannot be compiled.

Additional Context

OS: MacOS 14.3 (Sonoma), M2

@wdanilo wdanilo added the bug label Jan 14, 2025
@wdanilo wdanilo changed the title cannot find type Vec in this scope when compiling web-sys-0.3.76/src/features/gen_ImageData.rs:35:62 Cannot find type Vec in scope when compiling web-sys-0.3.76/src/features/gen_ImageData.rs:35:62 Jan 14, 2025
@daxpedda
Copy link
Collaborator

I assume you are using it with default-features = false as well. This was fixed in #4378.
web-sys v0.3.77 includes this fix.

Let me know if updating does not solve your problem!

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants