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

App displays blank screen when migrating from a previous version #4585

Closed
nonfungibletunji opened this issue Aug 28, 2018 · 24 comments
Closed
Labels
bug For issues that describe a defect or regression in the released software

Comments

@nonfungibletunji
Copy link

nonfungibletunji commented Aug 28, 2018

Issue Description

The latest release 1.15 produces a blank screen on initial load.

javascript error logged in the browser console.
TypeError: undefined is not an object (evaluating 'this.props.shop.name')

Steps to Reproduce

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

Push To Heroku Button

  1. Hit push to Heroku button
  2. Fill in the the required coif var
  3. The page loads a blank screen

or

Reaction Docker Compose Up

or

reaction command line

Possible Solution

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

Versions

1.15

@spencern
Copy link
Contributor

spencern commented Aug 28, 2018

I'm running the latest release and just started the app using docker-compose up and am not seeing this issue. Are you seeing any server errors? Do you have any custom plugins installed?

@nonfungibletunji
Copy link
Author

undefined is not an object (evaluating 'this.props.shop.name')

@dancastellon
Copy link
Contributor

@stunjiturner Is this a fresh install, or are you trying to upgrade from an earlier version?

@nonfungibletunji
Copy link
Author

nonfungibletunji commented Aug 28, 2018 via email

@brent-hoover
Copy link
Collaborator

Just tried this from a fresh install (reaction init) and everything was fine but I did see it when trying to upgrade the swag shop site to 1.15.0. Have not dug in deeper yet

@nonfungibletunji
Copy link
Author

@zenweasel have you tried the deploy to heroku button? That’s not working either and that’s independent of my developer work environment? I will investigate on a new machine

@brent-hoover
Copy link
Collaborator

brent-hoover commented Aug 29, 2018

Looks like this happens if I:

  1. Do a fresh clone
  2. Check out v.14.1
  3. Start the app
  4. Stop the app
  5. Check out v1.15.0
  6. rm -rf node_modules && meteor npm install
  7. Start the app

So it is probably missing a migration somewhere?

@brent-hoover
Copy link
Collaborator

I don't see any errors in either client or server though. Just completely blank.

@brent-hoover brent-hoover changed the title No homepage load App displays blank screen when migrating from a previous version Aug 29, 2018
@brent-hoover
Copy link
Collaborator

Resetting the db fixes it so it's probably a migration issue.

@brent-hoover brent-hoover added bug For issues that describe a defect or regression in the released software impact-major and removed needs-to-be-reproduced labels Aug 29, 2018
@nonfungibletunji
Copy link
Author

nonfungibletunji commented Aug 29, 2018 via email

@brent-hoover
Copy link
Collaborator

@stunjiturner yes

@nonfungibletunji
Copy link
Author

nonfungibletunji commented Aug 29, 2018

I can confirm that a fresh install is possible, using

rm -rf node_modules && meteor npm install
reaction reset -n
reaction

still nothing using 1.15 and latest swag-shop, anybody test the deploy to heroku?

error:

undefined is not an object (evaluating 'this.props.shop.name') in js file, at method

                                renderShopSelect()
                                {
                                    return this.props.handleShopSelectChange ? s.createElement(u, {
                                        className: "shop-select",
                                        isTagNav: !0,
                                        onShopSelectChange: this.onShopSelectChange,
                                        shopName: this.props.shop.name,
                                        shops: this.props.shops,
                                        shopId: this.props.shop._id
                                    }) : null
                                }

@brent-hoover
Copy link
Collaborator

Testing the "Deploy to Heroku" button I see the same behavior that @stunjiturner was seeing (blank screen + errors in console). You can see this URL here for now: https://infinite-headland-32258.herokuapp.com/

@spencern
Copy link
Contributor

@stunjiturner The error you're seeing seems to suggest that the shop is not available when running renderShopSelect - I'm curious if this is dependent on swag-shop. That would seem likely if not for @zenweasel's finding that deploy to heroku is also failing, I'm assuming without the swag shop?

@nonfungibletunji
Copy link
Author

nonfungibletunji commented Aug 30, 2018 via email

@brent-hoover
Copy link
Collaborator

@spencern The Heroku deploy was just stock Reaction without the swag shop. Which seems strange because there is no "migration" going on and a stock reaction init works fine so possibly there is more than one issue going on. Because when I tested a migration I didn't get the error that @stunjiturner was seeing but I did get a completely blank screen. 🤔

@spencern
Copy link
Contributor

@zenweasel I agree, it seems that perhaps we have multiple issues here.
I don't think this is specifically a "production" issue as we've been deploying a staging version for the past several releases and that still works.
I'm not seeing any issues running reaction within a docker container without the swag shop, but clearly something is off that's causing the client app not to render.

@brent-hoover
Copy link
Collaborator

@spencern It might be a "production" issue if users can't migrate from one version to another. It's actually blocking me from deploying the latest release to the demo site.

@spencern
Copy link
Contributor

Sure, what I meant by that is that it's not necessarily an issue that's only seen in code that's been bundled for production

@griggheo
Copy link
Contributor

One more observation here: I have also noticed the blank page issue when I run 1.15 with the catalog sample dataset from the starterkit.

@griggheo
Copy link
Contributor

Actually this happens with the dev dataset as well.

@nonfungibletunji
Copy link
Author

Any feedback on this issue from core team, I have a free day next week for this issue alone, if pointed in the correct direction

@brent-hoover
Copy link
Collaborator

I think @aldeed has a handle on this and you should probably see a fix coming down shortly. #4608

@aldeed
Copy link
Contributor

aldeed commented Sep 7, 2018

@stunjiturner If you need a quick fix, paste this in server startup code and it should fix it:

    import { Packages, Shops } from "/lib/collections";

    Packages.rawCollection().update({
      "layout.structure.template": "products"
    }, {
      $set: {
        "layout.$[elem].structure.template": "Products"
      }
    }, {
      arrayFilters: [{ "elem.structure.template": "products" }],
      multi: true
    });

    Packages.rawCollection().update({
      "registry.template": "products"
    }, {
      $set: {
        "registry.$[elem].template": "Products"
      }
    }, {
      arrayFilters: [{ "elem.template": "products" }],
      multi: true
    });

    Shops.rawCollection().update({
      "layout.structure.template": "products"
    }, {
      $set: {
        "layout.$[elem].structure.template": "Products"
      }
    }, {
      arrayFilters: [{ "elem.structure.template": "products" }],
      multi: true
    });

You can then delete it after it has run once against your database in each environment. We'll also put together a patch adding this migration if you want to wait for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software
Projects
None yet
Development

No branches or pull requests

6 participants