#White screen until browserlist warning?

39 messages · Page 1 of 1 (latest)

oblique zodiac
#

So everytime I do yarn tauri dev, and the window opens it's always white until this browserlist message shows up in the terminal and then everything is rendered. any idea why

dire oar
#

tbh it just sounds like your frontend server/bundler is a bit slow to start 🤔

oblique zodiac
dire oar
#

you could spawn the window hidden and then show it from the frontend, but since it should be dev-only that may be a bit much.
or idk, rewrite your frontend stack in something faster :/ (though all frameworks and tools will have that problem once your project is big enough.

oblique zodiac
#

the release version shows a white screen at first asw

dire oar
#

But not that long right, just a fraction of a second?

#

Because that'd be expected basically

oblique zodiac
#

this delay happens after the rust backend loads so after the run handler finishes

#

and before the frontend starts rendering

oblique zodiac
#

in the release version, it's just a white screen and nothing else

oblique zodiac
#
Environment
  › OS: Windows 10.0.22621 X64
  › Webview2: 119.0.2151.97
  › MSVC: 
      - Visual Studio Build Tools 2019
  › Node.js: 20.9.0
  › npm: 10.1.0
  › pnpm: 7.30.0
  › yarn: 1.22.19
  › rustup: 1.26.0
  › rustc: 1.73.0
  › cargo: 1.73.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.2.3
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.4,
  › tauri-build [RUST]: 1.2.1,
  › tao [RUST]: 0.15.8,
  › wry [RUST]: 0.23.4,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: React
  › bundler: Vite

App directory structure
  ├─ .git
  ├─ .vscode
  ├─ dist
  ├─ migrations
  ├─ node_modules
  ├─ public
  ├─ src
  └─ src-tauri```
#

my tauri info

#

on the release version, the frontend doesn't even load so I can't do ctrl+shift+i to debug

odd marlin
#

Do you run anything inside Tauri's .setup hook? Anything that runs for a long time in there will block the main thread which will delay the webview loading.

oblique zodiac
#

the delay occurs after the run callback finishes and before the frontend renders

#

with the release version, it's just stuck in a white screen so idk where to start debuing

dire oar
#

for the release issue. can you do a debug build via yarn tauri build --debug (output in target/debug/) and check the devtools console for errors?

oblique zodiac
#

i also have an error saying that require is not defined

#

otherwise the elements are empty

#

there's just a root element and nothing else

dire oar
#

i guess the require one is import then

#

i mean, require is indeed not a thing in a browser

oblique zodiac
#

holy shit that was the issue

#

that worked

#

just had to make vite use cjs

#

thank you so much @dire oar

lofty wave
#

I'm definitely seeing this same issue, but my javascript console is empty... if I build the app for debug, i get those same asset not found errors...

#

in my case its its these errors in the console:

Asset `favicon.ico` not found; fallback to favicon.ico.html
Asset `favicon.ico` not found; fallback to favicon.ico/index.html
Asset `favicon.ico` not found; fallback to index.html

And in the Javascript console, i see this:

#

so not the same require error

#

@dire oar any thoughts?

dire oar
#

Well, the asset not found errors are irrelevant really. The localhost:8097 error is weird though, that doesn't sound like something from tauri 🤔

lofty wave
#

LOL... yeah that was it

#

localhost:8097 was for React Dev Tools... Apparently on Windows this causes Webview to hang and wait for a response (which if i'm not running React Dev Tools, it just hangs)... On Mac its not an issue... Removing it seems to have fixed it