Skip to content

Commit 843c43d

Browse files
cookiefissionjustin808
authored andcommitted
Slight improvement to the 'no hydrated stores' error (#605)
* Slight improvement to the 'no hydrated stores' error This should make it more clear that rendering `redux_store_hydration_data` is required. This should more cleanly differentiate the two cases * Change hydrated stores error to be a list of actions
1 parent 62fb5d6 commit 843c43d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

node_package/src/StoreRegistry.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ export default {
3939
const storeKeys = Array.from(hydratedStores.keys()).join(', ');
4040

4141
if (storeKeys.length === 0) {
42-
const msg = 'There are no stores hydrated and you are requesting the store ' +
43-
`${name}. This can happen if you are server rendering and you do not call ` +
44-
"redux_store near the top of your controller action's view (not the layout) " +
45-
'and before any call to react_component.';
42+
const msg =
43+
`There are no stores hydrated and you are requesting the store ${name}.
44+
This can happen if you are server rendering and either:
45+
1. You do not call redux_store near the top of your controller action's view (not the layout)
46+
and before any call to react_component.
47+
2. You do not render redux_store_hydration_data anywhere on your page.`;
4648
throw new Error(msg);
4749
}
4850

0 commit comments

Comments
 (0)