#splashscreen behavior differs between dev and build

7 messages · Page 1 of 1 (latest)

stark monolith
#

Problem:

After running tauri build and opening the .exe copy placed in the target/release directory, my app is not triggering JS-side invoke api commands, despite them being present in the source code and functioning when the app is run through tauri dev.

Background:

After going through a modified setup process for a splashscreen: #1130606430127399064
I have successfully implemented the close_splashscreen command in my main.rs, which is then invoked in my app's JavaScript.
More specifically, I am calling invoke('close_splashscreen') within Svelte's onMount() function, which triggers when the component is loaded to the DOM. However the exe appears to load so quickly that both screens remain open.

#

@rich steppe Turns out, JSON order is actually just that important when load times move so fast.

rich steppe
#

Woah. That's not what I would have expected. They should both be registered before Tauri has a chance to build the window themselves.

stark monolith
#

I tried it on a total hunch, rebuilt the exe, works exactly as you'd expect. No idea why Tauri is running register and build sequentially.

#

Solution:

If your app has a splashscreen window, it must be listed first in the JSON array under windows in your tauri.conf.json. Run tauri build again after this change.

#

splashscreen behavior differes between dev and build

#

splashscreen behavior differs between dev and build