Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
setEditorHandler(errorLocation => {
console.log('setEditorHandler', errorLocation);
const fileName = encodeURIComponent(errorLocation.fileName);
const lineNumber = encodeURIComponent(errorLocation.lineNumber || 1);
fetch(
// Keep in sync with react-dev-utils/errorOverlayMiddleware
`${launchEditorEndpoint}?fileName=${fileName}&lineNumber=${lineNumber}`,
);
});
hotClient.useCustomOverlay({
showProblems(type, errors) {
const formatted = formatWebpackMessages({
errors,
warnings: [],
});
reportBuildError(formatted.errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({
name: 'client',
reload: true,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
setEditorHandler(errorLocation => {
console.log('setEditorHandler', errorLocation);
const fileName = encodeURIComponent(errorLocation.fileName);
const lineNumber = encodeURIComponent(errorLocation.lineNumber || 1);
fetch(
// Keep in sync with react-dev-utils/errorOverlayMiddleware
`${launchEditorEndpoint}?fileName=${fileName}&lineNumber=${lineNumber}`,
);
});
hotClient.useCustomOverlay({
showProblems(type, errors) {
const formatted = formatWebpackMessages({
errors,
warnings: [],
});
reportBuildError(formatted.errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({
name: 'client',
reload: true,
reportBuildError,
dismissBuildError,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
setEditorHandler((errorLocation) => {
const fileName = encodeURIComponent(errorLocation.fileName);
const lineNumber = encodeURIComponent(errorLocation.lineNumber || 1);
// Keep in sync with react-dev-utils/errorOverlayMiddleware
// eslint-disable-next-line no-undef
fetch(`${launchEditorEndpoint}?fileName=${fileName}&lineNumber=${lineNumber}`);
});
hotClient.useCustomOverlay({
showProblems(type, errors) {
reportBuildError(formatWebpackMessages({ errors, warnings: [] }).errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({ name: 'client', reload: true });
startReportingRuntimeErrors({ filename: '/assets/client.js' });
if (module.hot) {
module.hot.dispose(stopReportingRuntimeErrors);
}
reportBuildError,
dismissBuildError,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
setEditorHandler(errorLocation => {
const fileName = encodeURIComponent(errorLocation.fileName);
const lineNumber = encodeURIComponent(errorLocation.lineNumber || 1);
fetch(
// Keep in sync with react-dev-utils/errorOverlayMiddleware
`${launchEditorEndpoint}?fileName=${fileName}&lineNumber=${lineNumber}`,
);
});
hotClient.useCustomOverlay({
showProblems(type, errors) {
const formatted = formatWebpackMessages({
errors,
warnings: [],
});
reportBuildError(formatted.errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({
name: 'client',
reload: true,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
window.EventSource = NativeEventSource || EventSourcePolyfill;
setEditorHandler(errorLocation => {
const fileName = encodeURIComponent(errorLocation.fileName);
const lineNumber = encodeURIComponent(errorLocation.lineNumber || 1);
fetch(
// Keep in sync with react-dev-utils/errorOverlayMiddleware
`${launchEditorEndpoint}?fileName=${fileName}&lineNumber=${lineNumber}`,
);
});
hotClient.useCustomOverlay({
showProblems(type, errors) {
const formatted = formatWebpackMessages({
errors,
warnings: [],
});
reportBuildError(formatted.errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({
name: 'client',
reload: true,
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import hotClient from 'webpack-hot-middleware/client';
import launchEditorEndpoint from 'react-dev-utils/launchEditorEndpoint';
import formatWebpackMessages from 'react-dev-utils/formatWebpackMessages';
import {
reportBuildError,
dismissBuildError,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
hotClient.useCustomOverlay({
showProblems(type, errors) {
const formatted = formatWebpackMessages({
errors,
warnings: [],
});
reportBuildError(formatted.errors[0]);
},
clear() {
dismissBuildError();
},
});
hotClient.setOptionsAndConnect({
name: 'client',
reload: true,