Comments (9)
How do you have Babel configured?
I think when using babel-loader you should get errors into the middleware
from webpack-hot-middleware.
Thank you for the quick reply, here is my config:
{
// devtool:
// 'eval' - fast build, no source map
// 'source-map' - slowest build, but includes original code
// 'cheap-source-map' - faster source map, but not original code, lines only
// devtool: 'inline-source-map',
devtool: 'eval',
entry: [
'webpack-hot-middleware/client',
path.resolve(__dirname, 'client/scripts/index.js'),
],
output: {
path: path.resolve(__dirname, 'public'),
// publicPath: '/assets/',
filename: 'bundle.js',
},
resolve: {
alias: {
/* populated below (*) */
},
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
loaders: ['babel'],
},
{
test: /\.css$/,
loader: 'style!css',
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
// loaders: ['style', 'css?sourceMap', 'sass?sourceMap'],
},
// PNG / JPG
{
test: /\.(png|jpg)$/,
loader: 'url?limit=25000',
},
],
// avoid Webpack going through react dependencies in node_modules,
noParse: [
/* populated below (*) */
],
},
sassLoader: {
// includePaths: [path.resolve(__dirname, './some-folder')],
},
babelLoader: {
// cacheDirectory - When set, the given directory will be used to cache the results of the loader.
// blank value defaults to OS temporary file directory.
cacheDirectory: true,
},
plugins: [
new HtmlWebpackPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
};
.babelrc
{
"presets": ["es2015", "react"],
"sourceMaps": true,
"env": {
"development": {
"plugins": [
["react-transform", {
"transforms": [
{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}
]
}]
]
},
"production": {
}
},
"plugins": ["transform-runtime"]
}
from webpack-hot-middleware.
Hrm, nothing there looks obviously out of place.
This example https://github.com/glenjamin/ultimate-hot-reloading-example (which still uses babel 5) does what you describe - so there must be something to do with your config or changes in babel-loader or webpack that have broken this.
from webpack-hot-middleware.
Are you sure it outputs compile erros to browser? and not only runtime errors?
Does it work on your machine?
from webpack-hot-middleware.
It does, yeah. I messed up the syntax on purpose and got the colourful console error as well as the red box in the browser.
Is it also missing for you if you use the example I posted?
from webpack-hot-middleware.
It does work there, now I'm trying to find the problem. I found that the following option was in the working example, and missing in my config (see screenshot), but when I tried adding it to my webpack.config , babel errored: "Unknown option: base.optional":
from webpack-hot-middleware.
That particular option is one that existed in Babel 5, but doesn't in Babel 6 - it looks like you have the equivalent in your code
from webpack-hot-middleware.
transform-runtime?
ok, then i'll continue exploring the differences and report back
from webpack-hot-middleware.
It seems that I was missing react-dom, so it silently failed to work.
from webpack-hot-middleware.
Related Issues (20)
- TypeError: cb is not a function HOT 1
- error TS2339: Property 'compilers' does not exist on type 'Compiler'. HOT 1
- Which package to use on a Deno server? HOT 1
- `webpack-hot-middleware/client?reload=true` is no longer working with webpack 5. HOT 36
- not work on webpack5 HOT 7
- Overlay is not working with Webpack 5 HOT 4
- Ignored an update to unaccepted module - No automatic page reloading with recent versions of webpack and react packages HOT 3
- Types are broken with Webpack 5 HOT 3
- `module.hot` is required ?
- enable use of other backends besides express
- when updating the example everything will break please update HOT 4
- ReDoS Vulnerability HOT 2
- Replace deprecated querystring component with builtin URLSearchParams API HOT 8
- Overlay is invalid in webpack5. Haven't you solved it yet? How long do you plan to publish it to the master? I hope you can reply
- Hot Updates not being handled by server HOT 2
- Opening 5+ tabs causes Express to hang indefinitely HOT 2
- webpack-hot-server-middleware on demand loading bug
- webpackv5 webpack-hot-server-middleware Compatibility problems HOT 1
- A Chrome specific issue, where requests are getting blocked after a handful of link clicks HOT 3
- Webpack 5: incorrect compilation error text output starting with "undefined undefined" HOT 3
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 webpack-hot-middleware.