Closed
Description
- Operating System: Windows 10
- Node Version: 11.1.0
- NPM Version: 6.4.1
- webpack Version: 4.27.1
- webpack-dev-server Version: 3.2.0
- This is a bug
- This is a modification request
Code
// startWebpackDevServer.ts
/** `ssl` contains the `key` and `cert` properties as raw strings, rather than filenames */
const { ssl } = getUserConfig();
httpsConfig = {
https: {
...ssl,
},
};
const server = new WebpackDevServer(
compiler,
Object.assign(
httpsConfig,
{
port: 3000,
inline: true,
quiet: false,
noInfo: false,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'true',
},
stats: 'errors-only',
reporter: reporter,
},
config.devServer
)
);
Expected Behavior
webpack-dev-server
operates as it did prior to 3.2.0, without throwing an exception
Actual Behavior
(node:15556) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, lstat '-----BEGIN RSA PRIVATE KEY-----
<<REDACTED>>
-----END RSA PRIVATE KEY-----
'
at Object.lstatSync (fs.js:861:3)
at new Server (D:\vso\client-web\node_modules\owa-build\node_modules\webpack-dev-server\lib\Server.js:573:38)
For Bugs; How can we reproduce the behavior?
Pass the raw SSL key and/or cert, rather than a Buffer or filepath, to the https config