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

Next - Images don't generate #34

Closed
yamiteru opened this issue Mar 17, 2021 · 6 comments
Closed

Next - Images don't generate #34

yamiteru opened this issue Mar 17, 2021 · 6 comments

Comments

@yamiteru
Copy link

Hey so I've tried the next branch today and whilst I was trying to find the easiest and least painful way of importing a directory full of images in different sizes and formats.

There are 2 issues:

  1. build doesn't generate any images at all
  2. dev generates only the last imported image and uses it as src in all other images (but other data such as width or height are correct)

Here is the repo with the issue: https://github.com/YamiteruXYZ/imagetools-workbench

BTW I'm gonna use this repo to experiment with imagetools and it might be a source of some demos or starters.

@JonasKruckenberg
Copy link
Owner

That's weird, I kinda expected this a bit to be honest since I changed the way images get generated in devmode completely (streaming the image to the browser instead of copying around a ton of files).

I didn't change the way images get generated in build mode at all so that's kinda weird.

I'll have a look a your repo and try to troubleshoot it!
Regarding examples,I think I'd be cool if you open up a PR for an example using solid when the time is right (i.e. the plugin actually works 😅)

@JonasKruckenberg
Copy link
Owner

I'll probably won't be able to get back to this before tomorrow or friday, I'm kinda busy right now, but don't worry we'll get that fixed 👍🏻

@yamiteru
Copy link
Author

That's weird, I kinda expected this a bit to be honest since I changed the way images get generated in devmode completely (streaming the image to the browser instead of copying around a ton of files).

I didn't change the way images get generated in build mode at all so that's kinda weird.

I'll have a look a your repo and try to troubleshoot it!
Regarding examples,I think I'd be cool if you open up a PR for an example using solid when the time is right (i.e. the plugin actually works 😅)

Yes I'll definitely create a PR once the lib works 😂

I'll probably won't be able to get back to this before tomorrow or friday, I'm kinda busy right now, but don't worry we'll get that fixed 👍🏻

No problem. I like your spirit!

@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented Mar 18, 2021

Alright, I've been experimenting a bit:
From what I can tell It doesn't seem like this is not a problem with imagetools directly but rather your specific setup since for me it worked perfectly.
To make sure though I changed how image IDs get generated. (It's not pushed yet I'll check out your repo first)

@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented Mar 19, 2021

I'm so stupid duh... You know what the issue was? 😆 Images IDs were basically the url params hashed, since the same configuration always produces the same image, but it was only the url params and so the image path was not taken into account. How stupid...

Anyway, the fixed version should be available from npm soon!

Edit:

And regarding your second issue with images not been generated in build mode, it seems like Vite is not picking up the import at all and that's why the images weren't included in the build. I don't know how or why it is different in build mode, but Vite-imagetools has nothing to do with that. It never gets told about any images in the first place.

JonasKruckenberg added a commit that referenced this issue Mar 19, 2021
This resolves #34, by including the images path when generating the internal image ID.
@yamiteru
Copy link
Author

Yeah that makes sense why it was loading the last imported image.

And regarding your second issue with images not been generated in build mode, it seems like Vite is not picking up the import at all and that's why the images weren't included in the build. I don't know how or why it is different in build mode, but Vite-imagetools has nothing to do with that. It never gets told about any images in the first place.

I see, so I'm gonna create an issue over in the Vite repo. Thanks for debugging man!

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

2 participants