tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] When built into exe app spams request to deno backend

Open demienYu opened this issue 2 years ago • 1 comments

Describe the bug

I have my app written with vuejs (front) and Deno (back). Front is making requests to Back using pretty standard Fetch API. When I start it with "npm run tauri dev" everything works just fine. Then I build it with "npm run tauri build". And when I run exe (from "release" folder), app starts to spam the same request to my Deno service endlessly. I just cannot conceive what causes such a behavior? On Deno side I can see this error: "Http - connection closed before message completed"

Reproduction

So to reproduce the bug I have to have running a simple deno server with just one method which returns some data from mongoDB database. In my case it is called "get-settings" and returns some settings form my app. On client side you may have simple vue js app which asks backend for settings when it starts. I use fetch api for this:

function getData(url: string): Promise<any> {
  return fetch(url, {
    method: 'GET',
    mode: 'cors',
    headers: {
      'Content-Type': 'text/plain',
    }
  }).then((response: any) => {
    // some usefull code
}

When you run program in dev mode (npm run tauri dev) everything works fine. Then you have to build app (npm run tauri build) and start an executable. You can see a lot of requests from tauri app in youк deno server.

Expected behavior

It should be just one request from tauri app run with compiled executable.

Full tauri info output

[✘] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 123.0.2420.65
    ✘ Couldn't detect any Visual Studio or VS Build Tools instance with MSVC and SDK components. Download from https://aka.ms/vs/17/release/vs_BuildTools.exe
    ✔ rustc: 1.75.0 (82e1608df 2023-12-21)
    ✔ cargo: 1.75.0 (1d8b05cdd 2023-11-20)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.12.2
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.8
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App
    - build-type: build
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:30794/
    - framework: Vue.js (Vue CLI)
    - bundler: Webpack

Stack trace

No response

Additional context

No response

demienYu avatar Apr 14 '24 17:04 demienYu

Need doublecheck that it is not the case of internal app error.

demienYu avatar Apr 15 '24 06:04 demienYu