empress / empress-blog

Fully-functional, SEO friendly static site implementation of a blog system built on Ember
https://empress-blog.netlify.com/
MIT License
179 stars 30 forks source link

Error While Rendering Responsive Image #126

Closed jrock2004 closed 2 years ago

jrock2004 commented 3 years ago

Not sure what is causing this but noticed my blog is no longer working and I see this error in console when I try to load the page

Error occurred:

- While rendering:
  -top-level
    application
      index
        post-card
          link-to
            responsive-image

There was an error running your app in fastboot. More info about the error: 
 Error: Assertion Failed: No image argument supplied for <ResponsiveImage>
    at assert (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/debug/index.js:178:1)
    at new ResponsiveImageComponent (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/addon-tree-output/ember-responsive-image/components/responsive-image.js:75:1)
    at EmberGlimmerComponentManager.createComponent (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/addon-tree-output/@glimmer/component/-private/base-component-manager.js:37:1)
    at EmberGlimmerComponentManager.createComponent (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/addon-tree-output/@glimmer/component/-private/ember-component-manager.js:54:1)
    at /var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/manager.js:551:1
    at deprecateMutationsInTrackingTransaction (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/validator.js:180:1)
    at CustomComponentManager.create (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/manager.js:550:1)
    at Object.evaluate (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:3267:1)
    at AppendOpcodes.evaluate (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:1284:1)
    at LowLevelVM.evaluateSyscall (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:5177:1)
    at LowLevelVM.evaluateInner (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:5133:1)
    at LowLevelVM.evaluateOuter (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:5125:1)
    at VM.next (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:6257:1)
    at VM._execute (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:6241:1)
    at VM.execute (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:6211:1)
    at /var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:6314:1
    at runInTrackingTransaction (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/validator.js:154:1)
    at TemplateIteratorImpl.sync (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:6314:1)
    at /var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7460:1
    at RootState.render (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7429:1)
    at /var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7776:1
    at inTransaction (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@glimmer/runtime.js:5019:1)
    at Renderer._renderRoots (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7756:1)
    at Renderer._renderRootsTransaction (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7808:1)
    at Renderer._renderRoot (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7743:1)
    at Renderer._appendDefinition (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7650:1)
    at Renderer.appendOutletView (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/@ember/-internals/glimmer/index.js:7632:1)
    at invokeWithOnError (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/backburner.js:349:1)
    at Queue.flush (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/backburner.js:229:1)
    at DeferredActionQueues.flush (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/backburner.js:426:1)
    at Backburner._end (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/backburner.js:960:1)
    at Backburner._boundAutorunEnd (/var/folders/0v/0wjp16zs5jzbhy9_ny57lxdr0000gn/T/broccoli-40441H6lSLgOASPYu/out-545-append_ember_auto_import_analyzer/assets/backburner.js:629:1)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Seems like it has to do with images that are put in image meta tag. If I remove that then I do not get these errors

NullVoxPopuli commented 3 years ago

I see this issue as well. Happened during some upgrades, here: https://github.com/NullVoxPopuli/website/pull/44

elwayman02 commented 2 years ago

@jrock2004 @NullVoxPopuli I believe you likely upgraded to ember-responsive-image v2, which had breaking changes.

I tracked that here, if anyone wants to take a shot at fixing it: https://github.com/empress/empress-blog-casper-template/issues/39

The fix shouldn't be too difficult, it's just a matter of having time to go through the migration steps.

jrock2004 commented 2 years ago

So you are saying if I downgrade to version 1.0.1, it should be fixed again?

elwayman02 commented 2 years ago

Yes, in the short-term.

jrock2004 commented 2 years ago

Yeah, just confirmed this will work. I will look to see if I can help fix so we can go back to 3.x

elwayman02 commented 2 years ago

That would be great! The ticket I linked has a link to the migration steps, so if you're able to work out how to update the Casper template I'll happily work with the Empress team to ensure a release goes out with the fix once it's available.

jrock2004 commented 2 years ago

So it seems like the first thing that needs to happen is move the following from config dir to ember cli build

'responsive-image': {
      sourceDir: 'images',
      destinationDir: 'responsive-images',
      quality: 80,
      supportedWidths: [2000, 1000, 600, 300],
      removeSourceDir: false,
      justCopy: false,
      extensions: ['jpg', 'jpeg', 'png', 'gif']
    },

Trying to remember how to do that for addons

jrock2004 commented 2 years ago

@elwayman02 Where is the component in the add-on that uses component?

elwayman02 commented 2 years ago

@jrock2004 you'll want to checkout and do a code search on the empress-blog-casper-template repo. For some reason GH search isn't returning results properly, but here's a link to one of the instances: https://github.com/empress/empress-blog-casper-template/blob/master/addon/templates/components/post-card.hbs#L5

elwayman02 commented 2 years ago

Another one is here: https://github.com/empress/empress-blog-casper-template/blob/master/app/templates/post.hbs#L31

jrock2004 commented 2 years ago

Ah so there are 2 projects we would need to update to fix this

elwayman02 commented 2 years ago

This project doesn't actually have a direct usage of ResponsiveImage, it just has the config because its demo app uses the casper template linked above. So you'll want to make all your fixes over in that repo, and once we release that version we can bump and update the config here in empress-blog. The config itself is a consumer-side change that every instance of empress-blog (your app, for example), will need to make when upgrading to the latest version of the casper template, IIRC.

For example, I have mine here: https://github.com/elwayman02/hella-drunk/blob/master/config/environment.js#L50-L58

The one that lives in this repo doesn't impact your app at all, it's only used for the in-repo demo app.

jrock2004 commented 2 years ago

Almost ready to PR this. Last thing I just need to figure out is how to put the config in ember-cli-build.js instead of config/environment

jrock2004 commented 2 years ago

@elwayman02 Can you look at the PR I created and see if there are things I need to change

NullVoxPopuli commented 2 years ago

The error I get solely by configuring responsive-image in my app is this:

Error occurred:

- While rendering:
  -top-level
    application
      index
        post-card
          link-to
            responsive-image

There was an error running your app in fastboot. More info about the error: 
 Error: Assertion Failed: No image argument supplied for <ResponsiveImage>
    at assert (/tmp/broccoli-3088664I5hNZz16mtcJ/out-578-broccoli_merge_trees/assets/@ember/debug/index.js:178:1)
    at new ResponsiveImageComponent (/tmp/broccoli-3088664I5hNZz16mtcJ/out-578-broccoli_merge_trees/assets/addon-tree-output/ember-responsive-image/components/responsive-image.js:75:1)
    at EmberGlimmerComponentManager.createComponent (/tmp/broccoli-3088664I5hNZz16mtcJ/out-578-broccoli_merge_trees/assets/addon-tree-output/@glimmer/component/-private/base-component-manager.js:37:1)

so, if anyone runs in to that, I believe we have to fix a bunch of stuff in the empress/template stuff before we'll be compat with the modern responsive-image addon (which is great, because webp, low-res rendering, etc. -- must have for good loading perf)

NullVoxPopuli commented 2 years ago

@jrock2004's PR seems good over here 💯

NullVoxPopuli commented 2 years ago

I believe this is resolved with latest casper template?

elwayman02 commented 2 years ago

Fixed by https://github.com/empress/empress-blog-casper-template/pull/37 and https://github.com/empress/empress-blog-casper-template/pull/45