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

Could possibly use a specific error message for this scenario #164

Closed
ryancole opened this issue Jun 18, 2016 · 1 comment
Closed

Could possibly use a specific error message for this scenario #164

ryancole opened this issue Jun 18, 2016 · 1 comment

Comments

@ryancole
Copy link

ryancole commented Jun 18, 2016

Just creating this issue to make a note of this. I'm just now converting from JSX routes to the plain object syntax, as well as using dynamic routing. I've got a route below ...

export default {
  path: "account",
  getChildRoutes(location, callback) {
    callback(null, [
      require("./detail").default
    ]);
  }
};

This route only serves the purpose of being the equivalent of ...

<Route path="account">
    <Route path=":username" component={AccountDetail} />
</Route>

In this case, in the JSX format, you'd not put relay queries prop on the account route if it is not a relay container. You'd put the queries on the detail route (it's a container).

Currently on the plain syntax, I had queries provided to the account route on accident. I was getting the following error ...

QueryAggregator.js:126 Uncaught TypeError: Cannot read property 'displayName' of undefined

That actual error is from some ternary logic within another error. Yes, I'm doing it wrong because I was accidentally providing queries on a route without a component, but perhaps we could use some logic prior to this line of code that warns about a component being undefined, etc. It shouldn't have gotten this far with an undefined component, I don't think?

@taion
Copy link
Member

taion commented Jun 19, 2016

I'll fix this, but please just submit a PR for this sort of thing going forward. It's a trivial code change and you clearly already found the call site that's generating the exception.

@taion taion closed this as completed Jun 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants