printpdf icon indicating copy to clipboard operation
printpdf copied to clipboard

Error building as wasm32-wasi target

Open ashokspeelyaal opened this issue 10 months ago • 1 comments

I have printpdf = "0.7.0" in my Cargo.toml

If I run my Rust binary independently, there are no issues. However, we are building all our services as wasm32-wasi targets.

When I run

cargo build --target wasm32-wasi

I get this issue: Note: I tried adding time = "0.3.34" as well.

Compiling printpdf v0.7.0 error[E0432]: unresolved importcrate::OffsetDateTime--> /<userdir>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/printpdf-0.7.0/src/document_info.rs:3:5 | 3 | use crate::OffsetDateTime; | ^^^^^^^^^^^^^^^^^^^^^ noOffsetDateTime` in the root | help: consider importing this struct instead | 3 | use time::OffsetDateTime; | ~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import crate::OffsetDateTime --> //.cargo/registry/src/index.crates.io-6f17d22bba15001f/printpdf-0.7.0/src/pdf_document.rs:10:5 | 10 | use crate::OffsetDateTime; | ^^^^^^^^^^^^^^^^^^^^^ no OffsetDateTime in the root | help: consider importing this struct instead | 10 | use time::OffsetDateTime; | ~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import crate::OffsetDateTime --> //.cargo/registry/src/index.crates.io-6f17d22bba15001f/printpdf-0.7.0/src/pdf_metadata.rs:3:5 | 3 | use crate::OffsetDateTime; | ^^^^^^^^^^^^^^^^^^^^^ no OffsetDateTime in the root | help: consider importing this struct instead | 3 | use time::OffsetDateTime; | ~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import crate::OffsetDateTime --> //.cargo/registry/src/index.crates.io-6f17d22bba15001f/printpdf-0.7.0/src/xmp_metadata.rs:3:5 | 3 | use crate::OffsetDateTime; | ^^^^^^^^^^^^^^^^^^^^^ no OffsetDateTime in the root | help: consider importing this struct instead | 3 | use time::OffsetDateTime; | ~~~~~~~~~~~~~~~~~~~~

error[E0432]: unresolved import crate::OffsetDateTime --> //.cargo/registry/src/index.crates.io-6f17d22bba15001f/printpdf-0.7.0/src/xobject.rs:4:5 | 4 | use crate::OffsetDateTime; | ^^^^^^^^^^^^^^^^^^^^^ no OffsetDateTime in the root | help: consider importing this struct instead | 4 | use time::OffsetDateTime; | ~~~~~~~~~~~~~~~~~~~~

For more information about this error, try rustc --explain E0432. error: could not compile printpdf (lib) due to 5 previous errors `

ashokspeelyaal avatar Mar 29 '24 10:03 ashokspeelyaal