We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to read a local file with fetch, but the request fails due to CORS error.
import { convertFileSrc } from "@tauri-apps/api/tauri"; ... const conv = convertFileSrc("DICOM_FILES/serie_0/IM0"); console.log(conv); const test = await fetch(conv); console.log(test);
Steps to reproduce the behavior:
yarn create tauri-app
src-tauri
Able to fetch to local file
yarn tauri info yarn run v1.22.10 warning package.json: No license field warning ../package.json: No license field $ tauri info app:spawn Running "/Users/antonio/tauri-app/node_modules/@tauri-apps/cli/bin/tauri-cli tauri info" +0ms Operating System - Mac OS, version 12.0.1 X64 Node.js environment Node.js - 12.20.0 @tauri-apps/cli - 1.0.0-beta.10 @tauri-apps/api - 1.0.0-beta.8 Global packages npm - 6.14.8 yarn - 1.22.10 Rust environment rustc - 1.53.0 cargo - 1.53.0 App directory structure /dist /node_modules /src-tauri /src App tauri.rs - 1.0.0-beta.8 build-type - bundle CSP - default-src asset: blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self' distDir - ../dist devPath - http://localhost:3000 framework - React ✨ Done in 5.47s.
The text was updated successfully, but these errors were encountered:
fix(core): enable CORS on the asset protocol, closes #2965
asset
66d6bb0
d28ac8a
lucasfernog
No branches or pull requests
Describe the bug
Trying to read a local file with fetch, but the request fails due to CORS error.
To Reproduce
Steps to reproduce the behavior:
yarn create tauri-app
src-tauri
where the app is runningExpected behavior
Able to fetch to local file
Screenshots
Platform and Versions (required):
The text was updated successfully, but these errors were encountered: