Not seeing error overlay
See original GitHub issueGiven the following files
package.json
"devDependencies": {
"@babel/core": "^7.0.0-beta.40",
"@babel/preset-env": "^7.0.0-beta.40",
"@babel/preset-react": "^7.0.0-beta.40",
"babel-loader": "8.0.0-beta.0",
"error-overlay-webpack-plugin": "^0.1.3",
"html-webpack-plugin": "^3.0.6",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.11",
"webpack-dev-server": "^3.1.1"
},
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
webpack.config.js
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin')
module.exports = {
mode: 'development',
entry: ['./src/index.js'],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
},
},
},
],
},
plugins: [
new ErrorOverlayPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './src/index.html',
}),
],
devServer: {
hot: true,
open: true,
},
}
index.js
import React from 'react'
import ReactDOM from 'react-dom'
ReactDOM.render(
<h1>{this.should.show.overlay}</h1>,
document.getElementById('root'),
)
if (module.hot) module.hot.accept()
index.html
<!DOCTYPE html>
<html lang="en">
<body><div id="root"></div></body>
</html>
Running yarn webpack-dev-server
results in a console error, but no overlay
Uncaught TypeError: Cannot read property 'should' of undefined
at eval (webpack:///./src/index.js?:9:76)
at Object../src/index.js (http://localhost:8080/main.js:1383:1)
at __webpack_require__ (http://localhost:8080/main.js:710:30)
at fn (http://localhost:8080/main.js:95:20)
at eval (webpack:///multi_./node_modules/error-overlay-webpack-plugin/lib/entry.js_(webpack)-dev-server/client?:4:18)
at Object.0 (http://localhost:8080/main.js:1394:1)
at __webpack_require__ (http://localhost:8080/main.js:710:30)
at http://localhost:8080/main.js:762:37
at http://localhost:8080/main.js:765:10
Issue Analytics
- State:
- Created 6 years ago
- Reactions:27
- Comments:34 (11 by maintainers)
Top Results From Across the Web
Missing Error Overlay #12014 - facebook/create-react-app
Hi, I have created and running new react app but the error overlay is not showing on the screen, i can only saw...
Read more >create react app - Disable error overlay in development mode
The error overlay can be disabled by using the stopReportingRuntimeErrors helper utility in the react-error-overlay package ...
Read more >How to get an error overlay with React Hot Loader - Jakob Lind
How to enable react error overlay for React Hot Loader. First, make sure you are using version 2.2.1 of webpack-dev-server. If you don't,...
Read more >react-error-overlay - npm
react-error-overlay is an overlay which displays when there is a runtime error. Development. When developing within this package, make sure you ...
Read more >Fix Screen Overlay Detected Error - Android - Verizon
1. From a Home screen, navigate: AppsSettings. If you're unable to access settings, first place your device into Safe mode. 2. Tap the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Im not using react error boundaries, but also don’t see the overlay
Update: Got it to work.
Turns out you need to have use
devtool: 'cheap-module-source-map'
because of a crossorigin issue.