question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise Error when creating route to a container

See original GitHub issue

I’m new to react and I decide to use this boilerplate for my first project. I don’t know if this is a bug or if I need to link some things manually, but when I create a container and a route to this new container with the generator, I get an error when I try to access this container.

The error is the following:

es6.promise.js:119 Unhandled promise rejection ReferenceError: injectAsyncReducer is not defined

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:38 (18 by maintainers)

github_iconTop GitHub Comments

6reactions
ivnmaksimoviccommented, Jul 2, 2016
  1. pulled repo
  2. npm run setup
  3. npm run clean
  4. npm run generate container (let’s call it “Surveys”)
  5. npm run generate route (“/surveys”)
  6. go to /surveys
  7. see blank page with console error “ReferenceError: injectReducer is not defined”
  8. go to app/routes.js
  9. uncomment “import { getAsyncInjectors } from ‘utils/asyncInjectors’;”
  10. uncomment “const { injectReducer, injectSagas } = getAsyncInjectors(store);”
  11. add store to createRoutes “export default function createRoutes(store) {”
2reactions
holoiiicommented, May 26, 2016

@ralomucho What do you mean by changing the default selector? (I’m getting the same error as @jamesmbowler)

Edit: Nevermind, I figured it out. A simple way to remove the error would be to do this:

const selectMyContainer = () => createSelector(
  selectMyContainerDomain(),
  (substate) => {
    return {}; //This is where you need to add the state for the container
  }
);

Double edit: Perhaps a good default for the template would be something like this instead? This way the errors won’t show up when nothing has changed.

const selectMyContainer = () => createSelector(
  selectMyContainerDomain(),
  (substate) => substate.toJS()
);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "Error: A <Route> is only ever to be used as the child of ...
The error message is pretty clear, wrap your Route components in a Routes component. The routes also don't take children (other than other...
Read more >
CannotPullContainer task errors - Amazon Elastic Container ...
The common cause for this error is because the VPC your task is using doesn't have a route to pull the container image...
Read more >
Initialization of sharing external failed ... - GitHub
It changes to another error: app.js:62 Uncaught (in promise) ReferenceError: app2 is not defined while loading "./routes" from webpack/container/reference/ ...
Read more >
4 Reasons Why Your Docker Containers Can't Talk to Each ...
After you finally containerise your Node.js app, you're eager to see if it works. You run it, but then this happens: "Error: connect...
Read more >
Let It Crash: Best Practices for Handling Node.js Errors on ...
An unhandledRejection error is a newer concept. It is emitted when a promise is not satisfied; in other words, a promise was rejected...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found