Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-transform-catch-errors and webpack-dev-server #17

Closed
stton opened this issue Dec 15, 2015 · 10 comments
Closed

react-transform-catch-errors and webpack-dev-server #17

stton opened this issue Dec 15, 2015 · 10 comments

Comments

@stton
Copy link

stton commented Dec 15, 2015

Currently trying to get react-transform-catch-errors to work with redbox-react while still using webpack-dev-server. I was able to get the react-transform-hmr to work with webpack-dev-server but am still not able to set it up with react-transform-catch-errors. Is this possible or does it have to be set up with webpack-hot-middleware (and express)?

@stton stton closed this as completed Dec 18, 2015
@stton stton reopened this Dec 18, 2015
@stton
Copy link
Author

stton commented Dec 18, 2015

Ended up just using webpack-dev-middleware and webpack-hot-middleware with react-transform-catch-errors and redbox-react. Works perfectly.

@stton stton closed this as completed Dec 18, 2015
@gaearon
Copy link
Owner

gaearon commented Dec 25, 2015

It should work with WebpackDevServer just fine. React Transform doesn't care what you use to connect to dev server. The fact that we use it with the middleware in the examples is just a coincidence. However we can't help you if you don't post a full project reproducing the issue.

@chibicode
Copy link

Having the same issue getting this to work w/ webpack-dev-server. Will report here if I figure out why. react-transform-hmr works fine...

image

@gaearon
Copy link
Owner

gaearon commented Dec 26, 2015

Please provide a way to reproduce.

@craig-jennings
Copy link

I am also seeing this behavior. If I run webpack-dev-server -d --history-api-fallback --inline --hot --no-info and create an error in a render method, I see a full page refresh and the error printed in the console. Below is the code that can reproduce this:

import configureStore from './configure-store';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';

class App extends React.Component {
  render() {
    return (<div>Hello World</div>);
    // Swap above with below to create error
    // return (<div>Hello World<div>);
  }
}

const root = document.querySelector('#root');
const store = configureStore();

ReactDOM.render((
  <Provider store={store}>
    <App />
  </Provider>
), root);

@gaearon
Copy link
Owner

gaearon commented Jan 13, 2016

@craigjennings11

This transform just catches runtime errors. What you show is a syntax error. It is unrelated to this transform.

@craig-jennings
Copy link

Hmm, I may not be explaining it properly. While the server is running, I switch those lines and save the file. This causes a full refresh and console error.

When I watch the demo gif here, there is a point where the text changes from {{ color: this.props.color }} to {{ color: this.props,.color }} and an error appears without a refresh. If I adjust my example to match that, I still see a full page refresh and console log.

example

@craig-jennings
Copy link

Note that I can also reproduce this with https://github.com/rackt/redux/tree/master/examples/counter by running webpack-dev-server --hot --inline

@gaearon
Copy link
Owner

gaearon commented Jan 13, 2016

What you want is unrelated to this transform.

Syntax error overlay is a feature of a different project called webpack-hot-middleware. It's a replacement for webpack-dev-server.

@craig-jennings
Copy link

Gotcha, thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants