webpack-dev-middleware icon indicating copy to clipboard operation
webpack-dev-middleware copied to clipboard

DllReferencePlugin fails when using webpack-dev-server

Open HQidea opened this issue 6 years ago • 8 comments

Do you want to request a feature or report a bug?

report a bug

What is the current behavior?

When using DllReferencePlugin with webpack-dev-server or webpack-dev-middleware, it will occurs an error:

Error: ENOENT: no such file or directory, open '/path/to/js/manifest.json'
    at Error (native)

If the current behavior is a bug, please provide the steps to reproduce.

const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config');
const compiler = webpack(config);
const server = new WebpackDevServer(compiler, {});

server.listen(8080, '127.0.0.1', () => {
  console.log('Starting server on http://localhost:' + 8080);
});

and the webpack.config is just from this project's example directory, https://github.com/webpack/webpack/blob/master/examples/explicit-vendor-chunk/webpack.config.js

What is the expected behavior?

run correctly like the code below:

const webpack = require('webpack');
const config = require('./webpack.config');

webpack(config, (err, stats) => {
  process.stdout.write(stats.toString() + "\n");
});  // this runs ok

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

node version: 6.9.0 webpack version: 3.8.1

HQidea avatar Nov 08 '17 07:11 HQidea

yep, sorry that's not implemented yet.

The problem is that the file is written into the in-memory filesystem, but the other compilation tries to read it from the real filesystem. Maybe we need to overlay the in-memory filesystem on top of the input filesystem.

sokra avatar Nov 09 '17 14:11 sokra

@sokra is any solution/workaround for that? I'm having the same problem but when i'm trying to build the production build.

jetpack3331 avatar Oct 09 '19 11:10 jetpack3331

@jetpack3331 no, you can send a PR

alexander-akait avatar Oct 09 '19 12:10 alexander-akait

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

webpack-bot avatar Jan 09 '20 02:01 webpack-bot

bump

alexander-akait avatar Jan 09 '20 10:01 alexander-akait

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

webpack-bot avatar Apr 24 '20 20:04 webpack-bot

I think it can be solved using writeFiles, but let's add tests for this case, keep open

alexander-akait avatar Aug 10 '20 14:08 alexander-akait

Same problem - https://github.com/webpack/webpack-dev-middleware/issues/861

alexander-akait avatar Sep 13 '21 20:09 alexander-akait

Fixed in webpack v5, we split fs into to things inputFileSystem and outputFileSystem, so no problem anymore

alexander-akait avatar May 02 '23 22:05 alexander-akait