nuxt-image-loader-module icon indicating copy to clipboard operation
nuxt-image-loader-module copied to clipboard

forceGenerateImages and non-existent images

Open Jesus82 opened this issue 7 years ago • 4 comments

Hi, first of all, big thank you for this component, it really brings the best of gulp processing-style into nuxt.

I'm facing an scenario where I npm run generate with forceGenerateImages and some of the "original" images can be missing. If that happens, the generate process stops. Is there any way to let the generate process run even if there are some missing images?

Jesus82 avatar Dec 01 '18 21:12 Jesus82

Hi @Jesus82.

Thank you very much for the compliment. It's good to hear that this module is proving useful!

Do you know if this is still an issue? I haven't tried the test case where source images may be missing.

When I get time I'll check in and see if I can duplicate this.

Thanks,

Barry

Barry-Fisher avatar Feb 07 '19 13:02 Barry-Fisher

Hi Barry,

I can confirm I have this problem also if I remove some of the source files – say if they are declared in a JSON file somewhere and used by the app.

I get this warning for every size of the first missing image, the the process stops with a ✖ Nuxt Fatal Error:

 ERROR  Command failed: gm convert: Unable to open file (/Users/tempura/Dropbox/websites/the-entente-website/entente-nuxt-ssr/assets/images/batch-1/colophon-foundry-montefiore-type-specimen-2.jpg) [No such file or directory].                                       09:27:10
  
  at ChildProcess.onExit (node_modules/gm/lib/command.js:301:17)
  at ChildProcess.emit (events.js:188:13)
  at ChildProcess.EventEmitter.emit (domain.js:441:20)
  at maybeClose (internal/child_process.js:978:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)

This would be very helpful!

Best,

Simon

simonhrogers avatar Feb 11 '19 12:02 simonhrogers

Got the same issue! Subscribing

kissa1001 avatar Sep 19 '19 17:09 kissa1001

Please try a fix I just added to a new release 1.4.1 and let me know generating images works for you.

I added a check to see whether the source file exists and if it doesn't it skips generating that particular image and displays a warning at the console for each file that may be missing. E.g. Warning: Source file not found at ./content/cat.jpg. Perhaps you referenced this image somewhere and it has since been removed.

Barry-Fisher avatar Sep 20 '19 00:09 Barry-Fisher