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

fs-all feature does not include base64 crate #2336

Closed
cyyynthia opened this issue Aug 2, 2021 · 3 comments
Closed

fs-all feature does not include base64 crate #2336

cyyynthia opened this issue Aug 2, 2021 · 3 comments

Comments

@cyyynthia
Copy link

Describe the bug

When compiling Tauri with the fs-all feature only, the base64 crate is not included which causes compile errors.

To Reproduce

Steps to reproduce the behavior:

  1. Init a Tauri application
  2. Set the features allowlist in config to { "fs": { "all": true } } (effectively enabling the fs-all feature)
  3. Run tauri dev
  4. See error

Expected behavior

The app should compile and run properly

Platform and Versions (required):

Operating System - Arch Linux, version Rolling Release X64

Node.js environment
  Node.js - 16.4.2
  @tauri-apps/cli - 1.0.0-beta.6
  @tauri-apps/api - 1.0.0-beta.5

Global packages
  npm - 7.18.1
  yarn - 1.22.10

Rust environment
  rustc - 1.54.0
  cargo - 1.54.0

App directory structure
/dist
/src-tauri
/.git
/src
/node_modules

App
  tauri.rs - 1.0.0-beta.5
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'

Additional context

It seems the offending pull request is #1864, as base64 was referenced for fs-write-binary-file but not for fs-all.

Stack Trace

error[E0433]: failed to resolve: use of undeclared crate or module `base64`
   --> /home/cynthia/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-1.0.0-beta.5/src/endpoints/file_system.rs:359:3
    |
359 |   base64::decode(contents)
    |   ^^^^^^ use of undeclared crate or module `base64`

error[E0433]: failed to resolve: use of undeclared crate or module `base64`
  --> /home/cynthia/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-1.0.0-beta.5/src/error.rs:47:24
   |
47 |   Base64Decode(#[from] base64::DecodeError),
   |                        ^^^^^^ use of undeclared crate or module `base64`

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> /home/cynthia/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-1.0.0-beta.5/src/endpoints/file_system.rs:361:16
    |
361 |     .and_then(|c| {
    |                ^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[u8]`
help: function arguments must have a statically known size, borrowed types always have a known size
    |
361 |     .and_then(|&c| {
    |                ^

error: aborting due to 3 previous errors
@amrbashir
Copy link
Member

amrbashir commented Aug 3, 2021

Can you provide a minimal repo? I can't reproduce it on my end.

@cyyynthia
Copy link
Author

cyyynthia commented Aug 3, 2021

Sure, I've just made a repo here: https://github.com/cyyynthia/tauri-fs-all-2336

The important thing is really the tauri.conf.json (+ the Cargo.toml file) and the modification to the allowlist, as otherwise it's just what tauri init gives.

@amrbashir
Copy link
Member

yeah I can reproduce it with your repo, I couldn't reproduce it one of our examples so maybe it was fixed in dev, idk maybe @lucasfernog can confirm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants