rekit icon indicating copy to clipboard operation
rekit copied to clipboard

rekit-plugin-redux-saga not installing properly

Open cellerich opened this issue 7 years ago • 7 comments

As mentioned already in the Gitter Channel I thought I file an issue as well.

Steps to reproduce:

npm install -g rekit@latest rekit create cf03 cd cf03 npm install rekit-core@latest rekit-studio@latest redux-saga rekit install rekit-plugin-redux-saga npm install npm start

Everything compiles and start the 3 servers. When I try to add a new Feature in Rekit Studio i get the following error: image If I look at the source files there is also no "rootSaga.js" and no Saga Middleware injected in the Apps index.js

image

Either I do something terrible wrong or there might be a bug in the plugin-code.

Thanks for the great work on Rekit, which helps a beginner in React and Redux stuff to grasp concepts and insights around this cool stuff.

cellerich avatar Mar 04 '18 13:03 cellerich

Hi @cellerich , you need to run "npm install" before install the plugin, the correct order is:

npm install rekit install redux-saga

You don't need to install "rekit-studio" and "rekit-core" separately, they will be installed when run "npm install".

supnate avatar Mar 04 '18 14:03 supnate

Thanks @supnate. Will try this out immediately :-)

cellerich avatar Mar 04 '18 14:03 cellerich

Sorry to bother again. Maybe I'm asking "noob" questions: I tried the following in exact order:

rekit create cf01
cd cf01
npm install
rekit install rekit-plugin-redux-saga
npm start

If I open Rekit Studio and try to add new feature I get the same error as mentioned above in picture 1. I have globally installed react-saga and im using the following versions:

node --version
v9.5.0
npm --version
5.6.0

rekit-plugin-redux-saga is installed in the node_modules folder. But still no rootSaga.js in /src/common.

I'm running the terminal as Admin, so there should be no issues writing files. Here is the output after the rekit install rekit-plugin-redux-saga command:

rekit install rekit-plugin-redux-saga
Installing plugin:  rekit-plugin-redux-saga
Writing to package.json...
Executing install.js if exists...
Done.: 30012.496ms

cellerich avatar Mar 04 '18 15:03 cellerich

Hi @cellerich , could you try adding an async-action in an existing feature first? It seems there's bug when creating a feature the rootSaga.js is not auto initialized.

supnate avatar Mar 04 '18 15:03 supnate

Hi @supnate This did the trick! After adding another async action to a existing feature the needed adjustments to the necessary files where made. After this I can also create a new feature without errors.

Thanks so much, no I can continue to explore the "rekit-world"!

cellerich avatar Mar 04 '18 16:03 cellerich

That's great! Thanks for the patience! It's really a bug should be fixed.

supnate avatar Mar 04 '18 16:03 supnate

I'm using Rekit in my current project with redux-saga and rekit-redux-saga plugin. I noticed immediately that something was not working properly and I decided to fixed myself.

I believe that the rekit-redux-saga library was not updated (yet) to be compatible with the last version of redux-saga.

Here are the changes I did to make it work again

# src/common/rootSaga.js
import { all } from "redux-saga/effects";
...
function* rootSaga() {
  yield all(sagas.map(/* istanbul ignore next */ saga => saga())); // The all function was not before in this line
}

The redux-saga templates will still import the "delay" function that is not available anymore. Just remove that import. It's used only for demonstration purposes anyway.

dzegarra avatar May 15 '19 22:05 dzegarra