Hi,
So i’ve been trying to implement Raven for both AWS and React applications, I’m none too bothered at the moment about AWS but certainly the react app isn’t reporting unhandled exceptions, my App.js looks like the below, note I’ve included everything I’m importing and the general setup on the off chance something else is blocking it.
If required we have a private repo you can checkout and a deployed version of the app. I should point out we’re using create react app to produce the build.
import Raven from 'raven-js';
import React, { Component } from 'react'
import logger from 'redux-logger'
import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import createHistory from 'history/createBrowserHistory'
import { Route } from 'react-router'
import { ConnectedRouter, routerReducer, routerMiddleware, push } from 'react-router-redux'
//eslint-disable-next-line
import * as MDL from 'material-design-lite'
import './App.css'
import reducers from './reducers'
import LoginForm from './components/loginForm/loginForm'
import Searches from './components/Searches/Searches'
// Create a history of your choosing (we're using a browser history in this case)
const history = createHistory()
Raven.config('SOME_CONFIG').install();
// Build the middleware for intercepting and dispatching navigation actions
const middlewareRouter = routerMiddleware(history)
// Add the reducer to your store on the `router` key
// Also apply our middleware for navigating
const store = createStore(
combineReducers({
...reducers,
router: routerReducer,
}),
composeWithDevTools(applyMiddleware(middlewareRouter, thunk, logger)),
)
class App extends Component {
render() {
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<div className="App">
<Route exact path="/" component={LoginForm}/>
<Route exact path="/searches" component={Searches}/>
</div>
</ConnectedRouter>
</Provider>
)
}
}
export default App
I wanted to test the error reporting so I have a component which does this…
class Searches extends Component {
static defaultProps = {
searches: []
}
componentWillMount() {
this.props.actions.getSearches()
}
componentDidUpdate() {
var foobar
// THIS IS MEANT TO CAUSE AN ERROR(SEE BELOW)
console.log(foobar.test)
}
.....
I don’t seem to be getting any error reports but if I visit the app I get this in the console…
Any pointers?
Cheers
Marc