Comments (3)
I have the same problem. I only see the hot-middleware-overlay
from error-overlay-webpack-plugin.
If you are using WHM, you need to manually add the react-dev-utils/errorOverlayMiddleware
E.g.
app.use(errorOverlayMiddleware())
app.use(webpackDevMiddleware(compiler, devServerConfig))
app.use(webpackHotMiddleware(compiler, hotMiddlewareConfig))
The plugin will only add it automatically when using webpack-dev-SERVER
as seen in the code below:
var devServerEnabled = !!compiler.options.devServer;
if (devServerEnabled) {
var originalBefore = options.devServer.before;
options.devServer.before = function (app, server) {
if (originalBefore) {
originalBefore(app, server, compiler);
}
app.use((0, _errorOverlayMiddleware["default"])());
};
}
This should be added to the readme.
I had to do something like this because my paths were prefixed with webpack://
and it didn't like it.
import errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware'
import launchEditorEndpoint from 'react-dev-utils/launchEditorEndpoint'
import dotenv from 'dotenv'
// Loads REACT_EDITOR for example.
dotenv.config()
app.use((req, res, next) => {
// We get: 'webpack:///packages/app/src/pages/home/Home.tsx'
if (!req.url.startsWith(launchEditorEndpoint)) return
const fileName = req.query.fileName.replace('webpack:///', './')
req.query.fileName = fileName
console.log('Opening in editor:', fileName)
errorOverlayMiddleware()(req, res, next)
})
from error-overlay-webpack-plugin.
@vjpr answered.
from error-overlay-webpack-plugin.
Related Issues (20)
- CORS bug
- Absent type def for the plugin HOT 1
- DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. HOT 2
- SSR Support? HOT 1
- Critical security vulnerability in react-dev-utils HOT 1
- BUG: can't resolve 'querystring' HOT 1
- Potential Overwriting of setupMiddlewares in devServer
- error-overlay-webpack-plugin doesn't work correctly HOT 1
- Iframe does not load HOT 3
- Missing `querystring` dep in `package.json`
- npm -i does not install a 'src' directory
- Options has an unknown property 'before' HOT 6
- Can i use it with laravel mix? HOT 1
- Uses vulnerable version of react-dev-utils
- Uncaught ReferenceError: process is not defined HOT 1
- Deprecation warning log from webpack-dev-server.
- compatibility with both `ws` and `sockjs` HOT 1
- Cannot import into webpack.mjs HOT 2
- error with webpack 4 HOT 2
- Uncaught Error: Iframe has not been created yet.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from error-overlay-webpack-plugin.