bevy0.16.0-rc.1 build to wasm, runing can not load asset #18512
-
when bevy project build to Is it because specific configurations are needed for WASM? How should I solve it |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I found a |
Beta Was this translation helpful? Give feedback.
-
After I changed WebGL2 to WebGPU, the log showed that it supports a maximum of 8 textures, but 12 were loaded |
Beta Was this translation helpful? Give feedback.
-
My uneducated guess, looking at one of your comments, is that your webserver is not serving |
Beta Was this translation helpful? Give feedback.
-
your 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
.set(AssetPlugin {
// Wasm builds will check for meta files (that don't exist) if this isn't set.
// This causes errors and even panics on web build on itch or with SPA dev-servers.
// See https://github.com/bevyengine/bevy_github_ci_template/issues/48.
meta_check: AssetMetaCheck::Never,
..default()
}) |
Beta Was this translation helpful? Give feedback.
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: