dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Bundling SSG is broken

Open ifsheldon opened this issue 3 months ago • 3 comments

Problem

Steps To Reproduce

Hi I'm trying to migrate my portfolio template from 0.6 to 0.7. I followed instructions here https://dioxuslabs.com/learn/0.7/essentials/fullstack/static_site_generation and it worked before in dx 0.6. You mentioned in the documentation that non-deterministic code will cause some errors, but my code does not have any random components.

Steps:

  1. Clone the repo with dx0.7 branch https://github.com/ifsheldon/hack-portfolio/tree/dx0.7
  2. Run dx bundle --web --ssg --release (I added --release since otherwise it will generate debug artifacts)
  3. Serve the public folder with dufs: cd target/dx/hack-portfolio/release/web/public/ && dufs -A --port 80
  4. When open index.html, get a blank page and errors like below in the console
Image

Expected behavior

A working website

Screenshots

Environment:

  • Dioxus version: 0.7.1
  • Rust version: 1.91.1
  • OS info: macOS 26.1
  • App platform: fullstack

Questionnaire

ifsheldon avatar Dec 03 '25 07:12 ifsheldon

It looks like this issue is specific to the dx bundle command. Running the same project with dx build produces the right output. bundle and build should do the same thing for ssg apps, but it looks like bundle is currently skipping the prerender step

ealmloff avatar Dec 04 '25 20:12 ealmloff

OK, so should I wait for the bugfix? Or, is dx build pretty much the same in this case so that I can just use dx build instead?

If you want, you can use my repo and add it as an end-to-end test.

ifsheldon avatar Dec 05 '25 02:12 ifsheldon

We should fix this with bundle, but dx build --web --ssg --release does the exact same thing bundle should do for ssg builds

ealmloff avatar Dec 05 '25 14:12 ealmloff