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] no reading of external Url in build in expo/tauri project #7225

Closed
sweatben opened this issue Jun 16, 2023 · 4 comments
Closed

[bug] no reading of external Url in build in expo/tauri project #7225

sweatben opened this issue Jun 16, 2023 · 4 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@sweatben
Copy link

Describe the bug

Hello everyone,

Tauri is a great tool but could you help me? I don't know if it's a bug or a tauri configuration problem on my part.

When I read the problems, I tried a lot of things with no result.

In my Tauri/expo project, I can't play audio from an external url once I've built it, whereas in dev mode there's no problem.

Thanks in advance for your help.
Sans titre

Reproduction

repo for reproduction

https://github.com/sweatben/tauri_expo-av_test

Expected behavior

Once build play audio via expo-av for an external url

Platform and versions

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 114.0.1823.43
    ✔ MSVC:
        - Visual Studio Build Tools�2019
        - Visual Studio Community 2022
    ✔ rustc: 1.67.0 (fc594f156 2023-01-24)
    ✔ Cargo: 1.67.0 (8ecd4f20a 2023-01-10)
    ✔ rustup: 1.25.2 (17db695f1 2023-02-01)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.14.0
    - yarn: 1.22.19
    - npm: 9.7.1

[-] Packages
    - tauri [RUST]: 1.4.0
    - tauri-build [RUST]: 1.4.0   
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../build
    - devPath: http://localhost:19006/
    - framework: React
    - bundler: Webpack

Stack trace

No response

Additional context

No response

@sweatben sweatben added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 16, 2023
@sweatben sweatben changed the title [bug] [bug] no reading of external Url in build in expo/tauri project Jun 16, 2023
@FabianLars
Copy link
Member

i'm not completely sure if that changes the result, but i had to change distDir to ../web-build and use npx expo export:web (because npm run build-web told me too) and the audio worked fine for me.
Does changing these things change the build output? If so, what are the exact reproduction steps i should take with your repro?

@sweatben
Copy link
Author

ok, for this 'issue' I've redone a clean project where indeed you need npx expo export:web, change distDir and change identifier (not valid).

I should have tested it before because during my other tests I did npm audit fix in view of the errors. It's certainly audit fix that was breaking the links of my dependencies.

audio work for me too, I'm sorry for the inconvenience

In any case, thank you very much for your responsiveness!

I really appreciate tauri thank you for your work and involvement.

@sweatben
Copy link
Author

Hello. I restarted a clean main project, I still can't play the audio, but I found the error, does not seem to cause npm audit fix, it's just that my resources are http and not https.
I tried, as the doc says, to add :

{
  "tauri": {
    "allowlist": {
      "http": {
        "all": true, // enable all http APIs
        "request": true // enable HTTP request API
      }
    }
  }
}

and/or add scope without success

@FabianLars
Copy link
Member

the http scope is only applied to tauri's http client, nothing else.

So i guess you're hitting this: #3007 - there are a few workarounds in there but the most common one is probably the localhost plugin unless you can make your resource use https.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants