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

[bug] Asset protocol not configured to allow the path #3592

Closed
Worble opened this issue Mar 2, 2022 · 0 comments
Closed

[bug] Asset protocol not configured to allow the path #3592

Worble opened this issue Mar 2, 2022 · 0 comments
Assignees

Comments

@Worble
Copy link

Worble commented Mar 2, 2022

Describe the bug

I am attempting to retrieve Icons for the users currently installed applications. I already have the icon paths (under /usr/share/icons and /usr/share/pixmaps) and I am trying to use convertFileSrc so they can be shown in an image, however no matter what I try I get the error asset protocol not configured to allow the path: <path>.

I have my allowlist set as follows:

    "allowlist": {
      "fs": {
        "readFile": true,
        "readDir": true
      },
      "protocol": {
        "asset": true,
        "assetScope": ["/usr/share/icons/**/*.svg"]
      }
    },

And protocol-asset is added in tauri features in Cargo.toml

Some examples are /usr/share/icons/breeze/apps/48/okular.svg and /usr/share/icons/breeze/apps/48/gwenview.svg. I know the glob is correct since I'm already using it elsewhere in my application to find the icons. I've tried many different variations of the glob such as just the folder /usr/share/icons/** or /usr/share/icons/**/* and nothing appears to be working, as well as just putting in the direct path to the svg to see if it would load. Am I missing something?

Reproduction

No response

Expected behavior

No response

Platform and versions

Operating System - Arch Linux, version Rolling Release X64

Node.js environment
  Node.js - 17.6.0
  @tauri-apps/cli - 1.0.0-rc.5
  @tauri-apps/api - 1.0.0-rc.1

Global packages
  npm - 8.5.2
  pnpm - Not installed
  yarn - Not installed

Rust environment
  rustup - 1.24.3
  rustc - 1.59.0
  cargo - 1.59.0
  toolchain - stable-x86_64-unknown-linux-gnu 

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

App
  tauri - 1.0.0-rc.3
  tauri-build - 1.0.0-rc.3
  tao - 0.6.3
  wry - 0.13.3
  build-type - bundle
  CSP - default-src 'self' blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self' asset: https://asset.localhost
  distDir - ../dist
  devPath - http://localhost:8080/
  framework - React
  bundler - Webpack

Stack trace

No response

Additional context

No response

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