Giter VIP home page Giter VIP logo

Comments (5)

sotayamashita avatar sotayamashita commented on April 30, 2024

babel-plugin-react-transform just compile js file to other server like webpack dev server ?
http://webpack.github.io/docs/webpack-dev-server.html#combining-with-an-existing-server

from babel-plugin-react-transform.

joaovpmamede avatar joaovpmamede commented on April 30, 2024

I'm having the same problem, well not exactly the same problem what happens is that I get a notification on console:

HMR] Checking for updates on the server...
(program):81 [React Transform HMR] Patching StatsWidget
(program):20 [HMR] Updated modules:
(program):22 [HMR]  - 787
(program):41 [HMR] App is up to date.

but then nothing happens (no "reload").
Everything was running smoothly with react-hot-loader though.

webpack config:

config.entry.unshift('webpack/hot/only-dev-server');
config.entry.unshift('webpack-dev-server/client?http://0.0.0.0:8081/');

config.devServer = {
  hot: true,
  inline: true
};

Fixed: I had an error on my code, but apparently the server still receives and notify the file changes.

Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

from babel-plugin-react-transform.

zhbhun avatar zhbhun commented on April 30, 2024

Backend server on locahost:8080, webpack-middle-server on localhost:3000, when changing code, hot-module-replace request address is http://localhost:8081/__webpack_hmr, is any config can change this?

from babel-plugin-react-transform.

zhbhun avatar zhbhun commented on April 30, 2024

Oh! Config is in webpack-hot-middleware, not babel-plugin-react-transform. You need add path option to webpack-hot-middleware/client, like webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr.

from babel-plugin-react-transform.

gaearon avatar gaearon commented on April 30, 2024

Hi folks! Alas, this discussion is not relevant to this repo. Anything concerning the servers is best asked in Webpack or https://github.com/glenjamin/webpack-hot-middleware repos or chats. This repo is just for plugin that locates React components and wraps themโ€”itโ€™s not even related to hot reloading.

That said,

Fixed: I had an error on my code, but apparently the server still receives and notify the file changes.

Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

I highlighted the relevant part: most likely you have multiple Reacts in the bundle. Check with npm ls react and remove the extra ones.

from babel-plugin-react-transform.

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.