Razzle: Unexpected key found in previous state received by reducer

Created on 8 Apr 2016  路  7Comments  路  Source: jaredpalmer/razzle

Hi,

First of all: thanks for this useful boilerplate, great to get me started!

While trying to wrap my head around everything that is going on, I noticed that upon loading one of the posts pages directly (f.ex. http://localhost:5000/post/you-smart-you-loyal), the console spits out the following warning:

Unexpected key "currentPost" found in previous state received by the reducer. Expected to find one of the known reducer keys instead: "posts". Unexpected keys will be ignored.

When I reach the page by clicking on the link on the homepage, this warning does not appear.

Is this by design? Does this boilerplate assume there is always a single point of entry?

Most helpful comment

This message can appear when you do SSR and forgot to recompile the server side bundle, so it still works with the old reducers and generate the old state that createStore reads. Read more in this post.

All 7 comments

you mean this is a bug that could be fixed on the next releases of redux; nothing critical here ?

that is correct

馃憤

@jaredpalmer it's not just a warning, the reducer actually cleans up all the unexpected keys ...

@neekey I asked Dan about this a few months ago and he said it was in fact a warning not an error (despite being coded as an error). Feel free to submit a PR with a fix if you have time to dig deeper.

This message can appear when you do SSR and forgot to recompile the server side bundle, so it still works with the old reducers and generate the old state that createStore reads. Read more in this post.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corydeppen picture corydeppen  路  3Comments

krazyjakee picture krazyjakee  路  3Comments

pseudo-su picture pseudo-su  路  3Comments

MaxGoh picture MaxGoh  路  4Comments

sebmor picture sebmor  路  4Comments