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

push(url) generates error #376

Open
mikbur opened this issue Oct 22, 2019 · 0 comments
Open

push(url) generates error #376

mikbur opened this issue Oct 22, 2019 · 0 comments

Comments

@mikbur
Copy link

mikbur commented Oct 22, 2019

const routesMap = {
FOO: {
path: '/:client/:area?'
},
let url='/foo/bar'

this.props.dispach(push(url))=>url changes but afte a while(3seconds) this error occurs:

dispatch
C:/Projekt/mmkng/my-app/node_modules/redux-first-router/dist/es/connectRoutes.js:211
  208 | return function (action) {
  209 |   // We have chosen to not change routes on errors, while letting other middleware
  210 |   // handle it. Perhaps in the future we will explicitly handle it (as an option)
> 211 |   if (action.error) return next(action); // code-splitting functionliaty to add routes after store is initially configured
      | ^  212 | 
  213 |   if (action.type === ADD_ROUTES) {
  214 |     var _selectLocationState2 = selectLocationState(store.getState()),

If I instead use this code I do not get the error:
Let action=pathToAction(Url)
this.props.dispatch(action)
In redux-logger I see that the action is run twice but for dispatch(push) it is only logged once.

The different actions look thesame except the second meta.prev.pathname differs
actions logged with discpatch(push(url))
{ type: 'FOO', payload: { client: 'foo', subpage: 'bar' }, meta: { location: { current: { pathname: '/foo/bar', type: 'FOO', payload: { client: 'foo', subpage: 'bar' } }, prev: { pathname: '/foo/', type: 'FOO', payload: { client: 'foo' } }, kind: 'push' } } }
actions logged with discpatch(action)
{ type: 'FOO', payload: { client: 'foo', subpage: 'bar' }, meta: { location: { current: { pathname: '/foo/bar', type: 'FOO', payload: { client: 'foo', subpage: 'bar' } }, prev: { pathname: '/foo/bar', type: 'FOO', payload: { client: 'foo', subpage: 'bar' } }, kind: 'push' } } } { type: 'FOO', payload: { client: 'foo', subpage: 'bar' }, meta: { location: { current: { pathname: '/foo/bar', type: 'FOO', payload: { client: 'foo', subpage: 'bar' } }, prev: { pathname: '/foo', type: 'FOO', payload: { client: 'foo' } }, kind: 'push' } } }

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

1 participant