Skip to content

Commit cffb981

Browse files
authoredMay 18, 2017
Move error overlay middleware (facebook#2216)
1 parent 1e06ec9 commit cffb981

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed
 

‎config/webpackDevServer.config.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// @remove-on-eject-end
1111
'use strict';
1212

13-
const launchEditor = require('react-dev-utils/launchEditor');
13+
const errorOverlayMiddleware = require('react-error-overlay/middleware');
1414
const config = require('./webpack.config.dev');
1515
const paths = require('./paths');
1616

@@ -70,15 +70,8 @@ module.exports = function(proxy, allowedHost) {
7070
public: allowedHost,
7171
proxy,
7272
setup(app) {
73-
// This lets us open files from the crash overlay.
74-
app.use(function launchEditorMiddleware(req, res, next) {
75-
if (req.url.startsWith('/__open-stack-frame-in-editor')) {
76-
launchEditor(req.query.fileName, req.query.lineNumber);
77-
res.end();
78-
} else {
79-
next();
80-
}
81-
});
73+
// This lets us open files from the runtime error overlay.
74+
app.use(errorOverlayMiddleware());
8275
},
8376
};
8477
};

0 commit comments

Comments
 (0)
Please sign in to comment.