-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get the following issue on "npm start" #89
Comments
Seeing this as well with a very minimal configuration. Any luck fixing it? Edit: Potentially related to webpack/memory-fs#9 I have to fix the regex as shown there, and then also make sure my output path in webpack.config.js wasn't relative...ie build/bundles as opposed to ./build/bundles |
Nope, no luck. Tried Replacing the response line in the get request to res.sendFile(__dirname+"/../dist/index.html"); Still throws up the same error. |
Try logging out the path that's failing in Memory-fs, and see if it correctly starts with what the regex is testing for. I suspect it might not like that /../ in the path. |
Tried logging at various points before. But the path I get at applyPluginsAsync itself is empty. So digging further into it now. |
Finally figured out the issue. Also in the get handler I changed the handler to serve files only for index.html. Rest all is handled by middleware via next() callback Checkout the final config import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import webpackConfigBuilder from '../webpack.config';
import path from 'path';
const webpackConfig = webpackConfigBuilder('development');
const compiler = webpack(webpackConfig);
let app = express();
const middleware = webpackDevMiddleware(compiler,{
publicPath: '/',
contentBase: 'src',
stats: {
colors: true,
hash: false,
timings: true,
chunks: false,
chunkModules: false,
modules: false
}
});
app.use(middleware);
app.use(webpackHotMiddleware(compiler));
app.get('/', function response(req, res,next) {
if(req.url == '/') {
res.sendFile(path.join(__dirname,'../src/index.html'));
return;
}
next();
});
app.listen(8089, function onStart(err) {
if(err) {
console.log(err);
}
console.info("Listening on 8089, open in browser");
}); |
Finally figured out the issue. |
This is my configuration file
Where am I going wrong?
The text was updated successfully, but these errors were encountered: