#Production App saying "tauri.localhost has rejected connection"

17 messages · Page 1 of 1 (latest)

noble cosmos
#

After building and running the installer, the finaly exe is rejection connection (see screenshot)

#
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 123.0.2420.81
    ✔ MSVC: 
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.77.0 (aedd173a2 2024-03-17)
    ✔ cargo: 1.77.0 (3fe68eabf 2024-02-29)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.10.0
    - npm: 10.2.5

[-] 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 [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:4200/
    - framework: Angular
    - bundler: Webpack

This is my current "tauri info"

subtle burrow
#

What is your beforeBuildCommand in tauri.conf.json?

#

If it calls any scripts in package.json, please share those too.

noble cosmos
#

This is the tauri.conf.json ```{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "npm run build",
"beforeDevCommand": "npm run start",
"devPath": "http://localhost:4200",
"distDir": "../dist",
"withGlobalTauri": true
},
"package": {
"productName": "Karteikarten App",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": false
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.karteikarten.cozy",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null
},
"updater": {
"active": false
},
"windows": [
{
"fullscreen": false,
"height": 720,
"resizable": true,
"title": "Karteikarten App",
"width": 1280
}
]
}
}

#

and this is my package.json ``` {
"name": "karteikarten",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"tauri": "tauri"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.0.0",
"@angular/cdk": "^17.1.2",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/material": "^17.1.2",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/router": "^17.0.0",
"@angular/service-worker": "^17.0.0",
"@ng-select/ng-select": "^12.0.4",
"@tauri-apps/api": "^1.5.3",
"angular": "^1.8.3",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.9",
"@angular/cli": "^17.0.9",
"@angular/compiler-cli": "^17.0.0",
"@tauri-apps/cli": "^1.5.11",
"@types/jasmine": "~5.1.0",
"autoprefixer": "^10.4.16",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "~5.2.2"
}
}

#

when running npm run tauri dev the app works perfectly fine tho

subtle burrow
#

There's a dev server running in that context.

#

When you build for production, there is no server.

noble cosmos
#

I'm not excactly sure what that means

subtle burrow
#

When you visit https://example.com, there is a web server that provides the files. When you run tauri dev, it is a similar process. When you run tauri build then run the executable, there is no server and Tauri is fetching the files from the dist directory of your project.

subtle burrow
noble cosmos
subtle burrow
#

Does Angular 17 support static file export to web standard JS/HTML/CSS?

#

If so, it should work with Tauri.