Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA example is broken #3646

Open
tomjtoth opened this issue Jan 25, 2025 · 0 comments
Open

PWA example is broken #3646

tomjtoth opened this issue Jan 25, 2025 · 0 comments

Comments

@tomjtoth
Copy link

Problem

The below entry in Dioxus.toml causes everything from under <PROJECT_ROOT>/public to be copied under <BUILD_ROOT>/assets instead of <BUILD_ROOT>/:

[application]
asset_dir = "public"

The official PWA example is now broken. It's index.html includes links to /sw.js, manifest.json, but since both of them are under <PROJECT_ROOT>/public, they become available under <PROJECT_ROOT>/assets. Upon

Steps To Reproduce

Steps to reproduce the behavior:

  • open the Network tab in developer tools of the browser
  • run dx serve,
  • navigate to http://localhost:8080
  • inspect the responses to sw.js, favicon.ico, manifes.json
    • they all return the same content as index.html, since the server cannot find the requested resources

Expected behavior

Static assets should be deployed to <BUILD_ROOT>/.

Preferred fix:

  • copy the contents of asset_dir to <BUILD_ROOT>/

Optional step:

  • create a new entry in Dioxus.toml, e.g. asset_dir_dest which points to <BUILD_ROOT>/ by default, but can be overridden

Screenshots

Image

Image

Image

Environment:

  • Dioxus version: v0.6.2
  • Rust version: rustc 1.84.0 (9fc6b4312 2025-01-07)
  • OS info: Linux
  • App platform: web

Questionnaire

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant