Skip to content

fs-all feature does not include base64 crate #2336

@cyyynthia

Description

@cyyynthia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions