Skip to content

bevy0.16.0-rc.1 build to wasm, runing can not load asset #18512

Answered by mockersf
cherish-ltt asked this question in Q&A
Discussion options

You must be logged in to vote

your npm run dev command start a dev server configured for single page applications. every URL not found is replaced by the index.html file.
Bevy expects to get 404 errors for meta fails not found, but your dev server return a 200 status with html. Bevy fails to deserialise the meta file as its content is html instead of the expected content.

You can either fix your dev server to return 404 error for .meta files, or configure Bevy to not look for .meta files if you don't need them

To configure Bevy, when you add the DefaultPlugins to your app, do:

DefaultPlugins
    .set(AssetPlugin {
        // Wasm builds will check for meta files (that don't exist) if this isn't set.
        // This ca…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@cherish-ltt
Comment options

Comment options

You must be logged in to vote
2 replies
@cherish-ltt
Comment options

@cherish-ltt
Comment options

Answer selected by cherish-ltt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants