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

[Bug]: Error while getting products without assets #181

Open
1 task done
KeetTechSol opened this issue Mar 2, 2022 · 8 comments
Open
1 task done

[Bug]: Error while getting products without assets #181

KeetTechSol opened this issue Mar 2, 2022 · 8 comments
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@KeetTechSol
Copy link

KeetTechSol commented Mar 2, 2022

Expected Behavior

If any product does not have assets, it should still be displayed without an image or with a placeholder image.

Actual Behavior

Now throwing a runtime error and the entire category page is not displayed.

TypeError: Cannot read properties of null (reading 'sort')
at Object.getAgnosticSearchResult (facetGetters.ts?f8dc:129:1)
at VueComponent.eval (VM17945 Category.vue:439:84)
at Watcher.get (vue.runtime.esm.js?2b0e:4495:1)
at Watcher.evaluate (vue.runtime.esm.js?2b0e:4597:1)
at RefImpl.computedGetter [as value] (vue-composition-api.esm.js?a6f4:1093:1)
at VueComponent.eval (VM17945 Category.vue:451:120)
at Watcher.get (vue.runtime.esm.js?2b0e:4495:1)
at Watcher.evaluate (vue.runtime.esm.js?2b0e:4597:1)
at RefImpl.computedGetter [as value] (vue-composition-api.esm.js?a6f4:1093:1)
at VueComponent.eval (VM17945 Category.vue:454:56)

Error in product page

TypeError: Cannot read properties of null (reading 'preview')
at eval (RelatedProducts.vue?0c37:32:1)
at Proxy.renderList (vue.runtime.esm.js?2b0e:2646:1)
at Proxy.render (RelatedProducts.vue?0c37:24:1)
at eval (vue-composition-api.esm.js?a6f4:1425:1)
at activateCurrentInstance (vue-composition-api.esm.js?a6f4:1385:1)
at Proxy.$options.render (vue-composition-api.esm.js?a6f4:1425:1)
at VueComponent.Vue._render (vue.runtime.esm.js?2b0e:3569:1)
at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4070:1)
at Watcher.get (vue.runtime.esm.js?2b0e:4495:1)
at Watcher.run (vue.runtime.esm.js?2b0e:4570:1)

Possible Solution

No response

Steps to reproduce

  1. Add a product without an image in Vendure.
  2. Start Storefront
  3. Navigate to the category page which contains that product

What version of vendure integration are you using?

1.1.0

What version of Node.js are you using?

16.10.0

What browser (and version) are you using?

Chrome Version 98.0.4758.109

What operating system (and version) are you using?

macOS v12.2.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@KeetTechSol KeetTechSol added the bug Something isn't working label Mar 2, 2022
@ymaheshwari1
Copy link

I'm interested in working on this.

@KeetTechSol
Copy link
Author

Below are the codes where the null check is to be implemented.
packages/composables/src/getters/facetGetters.ts line 66
packages/theme/components/RelatedProducts.vue line 11
vuestorefront-community/template-vendure/components/RelatedProducts.vue line 11

@Baroshem
Copy link
Collaborator

Baroshem commented Mar 3, 2022

@ymaheshwari1

Sure, I will assign it to you. Thanks! If you need any assistance, let me know :)

@ymaheshwari1
Copy link

@Baroshem Do we have a default thumbnail to be displayed when we are not getting a product image?

@Baroshem
Copy link
Collaborator

@ymaheshwari1

I think Storefront UI provides that. @justyna-13 @AdamPawlinski could you please confirm?

@justyna-13
Copy link
Contributor

That's right. It looks like that
Screenshot 2022-03-11 at 06 21 14

@ymaheshwari1
Copy link

That's right. It looks like that Screenshot 2022-03-11 at 06 21 14

Ok Thanks

@ymaheshwari1
Copy link

ymaheshwari1 commented Mar 12, 2022

Hi,
Debugged this and found that the placeholder is actually displayed but the height for it gets set in px, that's why it's too small.
Found that from somewhere the img tag gets style being applied.
image

but in devtools, the height for the tag is displayed correct
image

@Baroshem Baroshem added this to To do in 2.0.0 May 12, 2022
@Baroshem Baroshem added this to the 2.0.0 milestone Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
2.0.0
To do
Development

Successfully merging a pull request may close this issue.

4 participants