Current behavior:
I'm upgrading from Webpack 4. I made a working config, which builds without errors, but breaks at dev run (au run or npm run start) with the following error: Uncaught SyntaxError: The URL 'https:/sockjs-node' is invalid.
the determineRewrittenPath() function receives the following string as the input:
Source/node_modules/webpack-dev-server/client/index.js?https://dev.example.com:8001 and returns the string with malformed query: Source/node_modules/webpack-dev-server/client/index.js?https:/dev.example.com:8001.
Please notice only one slash in the https protocol definition.
If I remove both path.normalize calls, webpack-dev-server works fine.
Expected/desired behavior:
What is the expected behavior?
I think that only the file system path part of the request should be normalized, and the query should be left untouched.
What is the motivation / use case for changing the behavior?
Prevent webpack-plugin from breaking things.
I'm submitting a bug report
Please tell us about your environment:
Operating System: Linux 5.10.42-1-MANJARO
Node Version: v16.3.0
NPM Version: 7.18.1
JSPM OR Webpack AND Version Webpack 5.41.1
Browser: all
Language: all
Current behavior: I'm upgrading from Webpack 4. I made a working config, which builds without errors, but breaks at dev run (
au run
ornpm run start
) with the following error:Uncaught SyntaxError: The URL 'https:/sockjs-node' is invalid
.I tracked it down to the following lines in
DistPlugin
: https://github.com/aurelia/webpack-plugin/blob/92f5d5d293f29f6748744370ac95ef4ccb8fc767/src/DistPlugin.ts#L39-L40the
determineRewrittenPath()
function receives the following string as the input:Source/node_modules/webpack-dev-server/client/index.js?https://dev.example.com:8001
and returns the string with malformed query:Source/node_modules/webpack-dev-server/client/index.js?https:/dev.example.com:8001
. Please notice only one slash in the https protocol definition.If I remove both
path.normalize
calls, webpack-dev-server works fine.Expected/desired behavior:
What is the expected behavior? I think that only the file system path part of the request should be normalized, and the query should be left untouched.
What is the motivation / use case for changing the behavior? Prevent webpack-plugin from breaking things.