#AssetNotFound("index.html") only on cargo tauri build. cargo tauri dev works fine.

18 messages · Page 1 of 1 (latest)

acoustic ivy
#

As the title says. Get the weird thing that when I build my app it shows nothing/tauri.localhost refused to connect(see screenshot). The most right one is with cargo tauri dev. Followed this for base for an tauri + sveltekit application: https://tauri.app/v1/guides/getting-started/setup/sveltekit/ I use JS and my distDir is ../build.
Dont really know whats causing this.
Ty in advance :)

Build a Tauri app using SvelteKit as the frontend build tool

slow burrow
#

In case you still face this issue please post the output of cargo tauri info and your sveltekit config for a start

acoustic ivy
#

Will do. Omw back from work might take an hour or so

acoustic ivy
#
cargo tauri info

Environment
  › OS: Windows 10.0.22621 X64
  › Webview2: 115.0.1901.183
  › MSVC: 
      - Visual Studio Community 2022
      - Visual Studio Build Tools 2019
  › Node.js: 18.10.0
  › npm: 8.19.2
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.25.2
  › rustc: 1.68.2
  › cargo: 1.68.2
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.2.3 (outdated, latest: 1.4.0)
  › @tauri-apps/api [NPM]: 1.4.0
  › tauri [RUST]: 1.4.1,
  › tauri-build [RUST]: 1.4.0,
  › tao [RUST]: 0.16.2,
  › wry [RUST]: 0.24.3,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http://localhost:5173/
  › framework: Svelte
  › bundler: Vite

App directory structure
  ├─ .svelte-kit
  ├─ build
  ├─ log-cleaner-rs
  ├─ node_modules
  ├─ src
  ├─ src-tauri
  └─ static

The log cleaner-rs is another project, doesnt get built with it but its exe is needed and part of external bins
svelte.config.js

import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    kit: {
        // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
        // If your environment is not supported or you settled on a specific environment, switch out the adapter.
        // See https://kit.svelte.dev/docs/adapters for more information about adapters.
        adapter: adapter()
    }
};

export default config;

slow burrow
#

It's not optional since tauri does not include a nodejs runtime

acoustic ivy
#

Hey @slow burrow Thanks for the response. Will take a look, tbh thought ssg might be "optional" but mb I guess. Since you say its not optimal, what might be a better option?

slow burrow
#

Since you say its not optimal, what might be a better option?
I said it's not optional (=it's required), not optimal. SSR just doesn't work in tauri so you have to put sveltekit into spa or ssg mode (or a mix of both). Which tbh is enough of a reason for me to not use sveltekit at all since i don't like file based routers anyway.

acoustic ivy
#

Oh lol misread mb

acoustic ivy
slow burrow
#

just because i rule out sveltekit doesn't mean i'd rule out svelte itself too. I'd just use vite+svelte with a code-centric router. But i'm also aware that this is a bit frowned upon ever since sveltekit was hyped up...

acoustic ivy
#

@slow burrow First of all thanks for all the help. Love you bro. Tbh as I said I work with Vue at work and dont have much knowledge about svelte was fun when I first tried out tho. Didnt want to implement my own router, so went with SvelteKit. Maybe when I have finished the project sveltekit I might see about that. For now again thanks. God bless you ❤️

#

(This means its fixed)

slow burrow
zinc gate
slow burrow