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

Full example crashes at typed + mapped values #104

Closed
janhohenheim opened this issue Feb 5, 2023 · 4 comments · Fixed by #109
Closed

Full example crashes at typed + mapped values #104

janhohenheim opened this issue Feb 5, 2023 · 4 comments · Fixed by #109

Comments

@janhohenheim
Copy link

janhohenheim commented Feb 5, 2023

When using both typed and mapped, a folder is expected to be of the form "foo/bar":


ut the examples don't do this:
#[asset(path = "images", collection(typed, mapped))]

As a side note, I cannot get the feature showcased in the linked line in the example to work at all in my projects. Does it currently work at all or am I simply missing something?

@janhohenheim janhohenheim changed the title Full example crashes at mapped values Full example crashes at typed + mapped values Feb 5, 2023
@NiklasEi
Copy link
Owner

NiklasEi commented Feb 5, 2023

The first line is acting on paths of the files inside the folder, which all have a path like folder/file. The example might have been broken because I hard-coded the file separator /. Could you try the example again, please?
The mapped property is only available on main. It will be in the next release 🙂

@janhohenheim
Copy link
Author

janhohenheim commented Feb 5, 2023

The fix you propose can't address the cause since I am on macOS. With the current main, I still get the following error:

thread 'main' panicked at 'Should be a folder', bevy_asset_loader\examples/full_collection.rs:20:10

I am also using the main branch in my own tests, but for some reason I can only get the following form to work:

#[asset(paths("folder/file_a", "folder/file_b"), collection(typed, mapped))]

instead of the simpler:

#[asset(path("folder"), collection(typed, mapped))]

@NiklasEi
Copy link
Owner

Can you please verify that the issue is resolved on the latest main?

@janhohenheim
Copy link
Author

janhohenheim commented Feb 24, 2023

Thanks for the fix! Getting the "Everything looks good!" message on main, testing a real world application now...
Update: everything works 🎉

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

Successfully merging a pull request may close this issue.

2 participants