Giter Site home page Giter Site logo

Comments (13)

zalmoxisus avatar zalmoxisus commented on May 11, 2024 1

@nirrek, thanks for the explanation. In the unbuilt (unuglified) extension TypeError: e is not a function becomes TypeError: reducer is not a function. Without the extension (and DevTools at all) I also get this error as TypeError: currentReducer is not a function and hmr doesn't work. While changing const nextReducer = require('../reducers'); to const nextReducer = require('../reducers').default; fixes it, which is actually the same as we get with babel-plugin-add-modules-exports.

I'm curious to see the case when the error occurs only with the extension enabled and especially looking forward to seeing how we can get actions hot reloaded.

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

As far as I know, HMR deals only with reducers (if you enable it in your store) as you can use replaceReducer for that. For action creators you do have to refresh the page manually. Does it work when you disable the extension?

About the "JavaScript TypeError saying e is not a function" cannot reproduce it with the counter example. Could you share an example? BTW, it would be a great contribution to have here a simple ImmutableJS example to check it when we implement new features.

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

Hey @garretto,

Even though I cannot reproduce it, should be fixed in 0.4.16. Could you please give it a try?

from redux-devtools-extension.

gaearon avatar gaearon commented on May 11, 2024

For action creators you do have to refresh the page manually.

To be fair action creators should be reloaded if you use React Hot Loader. They don't with React Transform—we'll fix that eventually but not very soon.

from redux-devtools-extension.

garretto avatar garretto commented on May 11, 2024

@zalmoxisus I tried with the new version and no dice. Something in the plugin prevents a full page reload. Also for editing reducers actually. Ended up just installing redux-dev-tools into my project and it works fine there.

Also should have mentioned I'm using react-transform-hmre @gaearon not react-hot-loader. Thanks for creating both of those by the way. :)

from redux-devtools-extension.

garretto avatar garretto commented on May 11, 2024

If I get some time I'll try to reproduce with the counter example.

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

That's strange, just tried babel-preset-react-hmre and don't see any difference. As I see, it also includes react-transform-hmr. A PR to the counter example to reproduce that, would be welcome.

from redux-devtools-extension.

nirrek avatar nirrek commented on May 11, 2024

The .babelrc of the react-transform-boilerplate looks like this:

{
  "presets": ["react", "es2015"],
  "env": {
    "development": {
      "presets": ["react-hmre"]
    }
  }
}

Whereas the .babelrc of the counter example looks like this:

{
  "presets": [ "es2015", "stage-0", "react" ],
  "plugins": [ "add-module-exports", "transform-decorators-legacy" ]
}

If you remove the add-modules-exports plugin from the counter example's .babelrc, you will see the error @garretto refers to. Namely: TypeError: e is not a function will be printed inside the devtools window if you update a reducer (counter.js in this particular case).

Similarly, if you install babel-plugin-add-modules-exports and add it to the .babelrc of your react-transform-boilerplate based project, hot loading of reducers should work.

from redux-devtools-extension.

gaearon avatar gaearon commented on May 11, 2024

FYI we added an explicit error message in Redux 3.1.5 for this.
reduxjs/redux#1321

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

@gaearon, unfortunately, this doesn't help in our case as replaceReducer doesn't get the nextReducer directly, but through liftReducer. May I add that exception also into the liftReducer's function?

from redux-devtools-extension.

gaearon avatar gaearon commented on May 11, 2024

Oh, good point. Want to make a PR?

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

@gaearon, gladly :)
I added the same message about nextReducer there as to be easier to google the error.

from redux-devtools-extension.

zalmoxisus avatar zalmoxisus commented on May 11, 2024

Should be fixed in v1.0.0-beta3 with more descriptive error. Thanks, @gaearon, the provided explanation for the error is great!

@garretto, if you still have that error and have time to provide an example or to add some hints on how to reproduce it, please reopen the issue.

from redux-devtools-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.