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

Where should images/videos go? Assets, public? somewhere else? #115

Open
emilyliquin opened this issue Mar 27, 2024 · 7 comments
Open

Where should images/videos go? Assets, public? somewhere else? #115

emilyliquin opened this issue Mar 27, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@emilyliquin
Copy link
Contributor

Images in assets don't seem to load on deployment (but work in dev mode)

@gureckis gureckis assigned gureckis and guydav and unassigned gureckis Apr 15, 2024
@guydav guydav added the question Further information is requested label Apr 15, 2024
@guydav
Copy link
Contributor

guydav commented Apr 15, 2024

Currently seems to work -- if anyone has an example where putting assets in /assets doesn't work, can you share it?

@guydav
Copy link
Contributor

guydav commented Apr 15, 2024

Closing the issue for now until proven this is a problem -- if someone has a new example I'll happily debug it.

@guydav guydav closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@rhezab
Copy link

rhezab commented Apr 15, 2024

Discussed with @emilyliquin and @guydav, we think the issue is when the image paths are string templates like bee-${i}.png. This is because of vite's static asset handling.

One solution is to put stuff in public/. Another solution is to do this.

Maybe add this to docs, at very least.

@rhezab rhezab reopened this Apr 15, 2024
@guydav
Copy link
Contributor

guydav commented Apr 15, 2024

I think we should implement this design pattern in an example somewhere (after making sure it actually works) and reference in the documentation:

function getImageUrl(name) {
  return new URL(`./dir/${name}.png`, import.meta.url).href
}

@rhezab maybe we should try it with your experiment?

@gureckis gureckis added this to the first version (v0.1.0) 🌱 milestone Apr 18, 2024
@rhezab rhezab self-assigned this Apr 18, 2024
@rhezab
Copy link

rhezab commented Apr 18, 2024

Agree with Guy, I'll test this out and then add a note about this to the documentation if this works.

@gureckis
Copy link
Member

I think @pclittle is about to go deep on exactly this issue because he has an experiment with a lot of videos that might need to preload so good chance to give him a recommendation and try it out!

@guydav
Copy link
Contributor

guydav commented Apr 20, 2024 via email

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

No branches or pull requests

4 participants