Reaction: Operator No products found

Created on 14 Nov 2019  Â·  17Comments  Â·  Source: reactioncommerce/reaction

Issue Description

When I login and enter http://localhost:3000/operator/products I see no products but errors in console:

ProfileImageWithData.js:67 Uncaught TypeError: Cannot read property 'viewer' of undefined
    at ProfileImageWithData.js:67
    at Query (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:320168)
    at renderWithHooks (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:210672)
    at updateFunctionComponent (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:212361)
    at beginWork (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:213371)
    at performUnitOfWork (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:217046)
    at workLoop (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:217086)
    at HTMLUnknownElement.callCallback (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:197883)
    at Object.invokeGuardedCallbackDev (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:197933)
    at invokeGuardedCallback (modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:197990)
modules.js?hash=54032cc20b589152bd2e905ef16f0748d26b2fa4:214851 The above error occurred in the <Query> component:
    in Query (created by ProfileImageWithData)
    in ProfileImageWithData (created by withState(ProfileImageWithData))
    in withState(ProfileImageWithData) (created by Context.Consumer)
    in WithComponents(withState(ProfileImageWithData)) (created by Dashboard)
    in div (created by Context.Consumer)
    in div (created by ForwardRef(Toolbar))
    in ForwardRef(Toolbar) (created by WithStyles(ForwardRef(Toolbar)))
    in WithStyles(ForwardRef(Toolbar)) (created by Context.Consumer)
    in header (created by ForwardRef(Paper))
    in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
    in WithStyles(ForwardRef(Paper)) (created by ForwardRef(AppBar))
    in ForwardRef(AppBar) (created by WithStyles(ForwardRef(AppBar)))
    in WithStyles(ForwardRef(AppBar)) (created by Context.Consumer)
    in PrimaryAppBar (created by WithStyles(PrimaryAppBar))
    in WithStyles(PrimaryAppBar) (created by Dashboard)
    in div (created by Dashboard)
    in Dashboard (created by WithStyles(Dashboard))
    in WithStyles(Dashboard) (created by WithWidth(WithStyles(Dashboard)))
    in WithWidth(WithStyles(Dashboard)) (created by Route)
    in Route (created by withRouter(WithWidth(WithStyles(Dashboard))))
    in withRouter(WithWidth(WithStyles(Dashboard))) (created by Context.Consumer)
    in WithComponents(withRouter(WithWidth(WithStyles(Dashboard)))) (created by Reaction(App))
    in Reaction(App) (created by Tracker(Reaction(App)))
    in Tracker(Reaction(App))
    in ThemeProvider
    in ThemeProvider
    in TranslationProvider (created by Tracker(TranslationProvider))
    in Tracker(TranslationProvider)
    in Router (created by BrowserRouter)
    in BrowserRouter
    in ApolloProvider

React will try to recreate this component tree from scratch using the error boundary you provided, ProfileImageWithData.
{name: "reaction-client", hostname: "localhost:3000", pid: undefined, level: 50, err: {…}, …}
err: {message: "Cannot read property 'viewer' of undefined", name: "TypeError", stack: "TypeError: Cannot read property 'viewer' of undefi…4032cc20b589152bd2e905ef16f0748d26b2fa4:217988:7)", code: undefined, signal: undefined}
hostname: "localhost:3000"
level: 50
msg: "{ componentStack: '\n    in Query (created by ProfileImageWithData)\n    in ProfileImageWithData (created by withState(ProfileImageWithData))\n    in withState(ProfileImageWithData) (created by Context.Consumer)\n    in WithComponents(withState(ProfileImageWithData)) (created by Dashboard)\n    in div (created by Context.Consumer)\n    in div (created by ForwardRef(Toolbar))\n    in ForwardRef(Toolbar) (created by WithStyles(ForwardRef(Toolbar)))\n    in WithStyles(ForwardRef(Toolbar)) (created by Context.Consumer)\n    in header (created by ForwardRef(Paper))\n    in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))\n    in WithStyles(ForwardRef(Paper)) (created by ForwardRef(AppBar))\n    in ForwardRef(AppBar) (created by WithStyles(ForwardRef(AppBar)))\n    in WithStyles(ForwardRef(AppBar)) (created by Context.Consumer)\n    in PrimaryAppBar (created by WithStyles(PrimaryAppBar))\n    in WithStyles(PrimaryAppBar) (created by Dashboard)\n    in div (created by Dashboard)\n    in Dashboard (created by WithStyles(Dashboard))\n    in WithStyles(Dashboard) (created by WithWidth(WithStyles(Dashboard)))\n    in WithWidth(WithStyles(Dashboard)) (created by Route)\n    in Route (created by withRouter(WithWidth(WithStyles(Dashboard))))\n    in withRouter(WithWidth(WithStyles(Dashboard))) (created by Context.Consumer)\n    in WithComponents(withRouter(WithWidth(WithStyles(Dashboard)))) (created by Reaction(App))\n    in Reaction(App) (created by Tracker(Reaction(App)))\n    in Tracker(Reaction(App))\n    in ThemeProvider\n    in ThemeProvider\n    in TranslationProvider (created by Tracker(TranslationProvider))\n    in Tracker(TranslationProvider)\n    in Router (created by BrowserRouter)\n    in BrowserRouter\n    in ApolloProvider' }"
name: "reaction-client"
pid: undefined
time: Thu Nov 14 2019 13:07:38 GMT+0200 (Eastern European Standard Time) {}
v: 0
__proto__: Object

Steps to Reproduce

Please provide starting context, i.e. logged in as a user, configure a particular payment method.

  1. git clone [email protected]:reactioncommerce/reaction-platform.git && cd reaction-platform && make
  2. http://localhost:3000/operator/products
  3. Check console

Possible Solution

Not obligatory, but suggest a fix/reason for the bug

Versions

(run npm run version --silent from your reaction directory)

bug

Most helpful comment

@zaibacu yes absolutely

I dont know if anyone of the company is taking care of the product.... We never get reactioncommerce via reaction platform up and running without a lot of bugs. So we think version 2.9.0 is unstable and has tons of bugs.
Or there are steps to do to get it up and running and nobody has documented it ;-)

All 17 comments

I resolved the console error issue by running below query in the mongo db.
db.Accounts.updateOne({"shopId" : "J8Bhq3uTtdgwZx3rz" },{ $set:{ "emails.0.provides" : "default"}});

I found the same issue.
The Product List stays empty. Inside the mongo database you can find the example products....

So is this an error during setup? Or is it an bug ?

Same issue. With all due respect, this looks like a major bug, but is kinda neglected.

@zaibacu yes absolutely

I dont know if anyone of the company is taking care of the product.... We never get reactioncommerce via reaction platform up and running without a lot of bugs. So we think version 2.9.0 is unstable and has tons of bugs.
Or there are steps to do to get it up and running and nobody has documented it ;-)

Yes, it seems 2.9.0 is unstable. Which version would be the most stable? I'm going to test 2.7.0.

2.7.0 has the bug as well.

I just tested v2.5.0 and it does not have the bug!

I just tested v2.5.0 and it does not have the bug!

Thank you. Tried 2.8.1 myself 🙂

This is also true for new tags and accounts @aldeed, the same error is displayed on both sections of the admin UI, although tags does display the example tag, but subsequent ones are not shown.

Hi, I tried to solve this problem and i found that when the default user is created, it doesn't set the attribute "provides" in the Account and user collections.

So I added "user.emails[0].provides = "default";" in the line 126 of file imports/plugins/core/accounts/server/init.js

// Automatically verify "localhost" email addresses
let emailIsVerified = false;
if (user.emails[0] && user.emails[0].address.indexOf("localhost") > -1) {
  user.emails[0].verified = true;
  user.emails[0].provides = "default";
  emailIsVerified = true;
}

I cleaned the database and restart the project.

@jhonsfran1165 would you be interested in submitting a PR? looks like you already did most of the legwork for this.

@jhonsfran1165 would you be interested in submitting a PR? looks like you already did most of the legwork for this.

https://github.com/reactioncommerce/reaction/pull/5935

Thanks @jhonsfran1165 ,

This issue seemed to be resolved by another related PR, #5926. If you think your resolution here is better we can take a look, otherwise I’ll close your PR.

Hi @kieckhafer I proved that solution but it doesn't work. I got the same error:

ProfileImageWithData.js:67 Uncaught TypeError: Cannot read property 'viewer' of undefined
at ProfileImageWithData.js:67

@jhonsfran1165

I believe that this ticket actually is comprised of two separate issues.

The title, Operator No products found, is one of them, and the description, ProfileImageWithData.js:67 Uncaught TypeError: Cannot read property 'viewer' of undefined, is a second issue.

While they may seem related, after doing some digging they seem to be two separate things that just happen to be seen at the same time.

The title issue, Operator No products found, is fixed by #5926, however, the other issue is still blocking that fix from showing. It's confusing, but bear with me...

The other issue, ProfileImageWithData.js:67 Uncaught TypeError: Cannot read property 'viewer' of undefined, has also been solved in a separate PR.

Therefore, if you use the release-2.9.1 branch to test this - that branch has both fixes in it - you should see that both issues are resolved.

I got it, thanks for that explanation @kieckhafer

resolved in release 2.9.1

Was this page helpful?
0 / 5 - 0 ratings