Unclear error message in case of Exclamation mark in project path breaking the build on Windows

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

What is the current behavior?
On Windows build if the path of the project folder contains “!”, webpack will throw error:

    ERROR in Entry module not found: Error: Can't resolve 'C:\' in 'C:\!ParentFolder\MyProjectFolder'

This bug was already reported #4906 with steps to reproduce. And it was closed, I’m opening this one to attract attention that this issue creates hard time for new users of webpack who do not know about this limitation, since webpack does not give any clue to the user about it. It took an hour of my time to figure out why it’s not working.

If the current behavior is a bug, please provide the steps to reproduce.
see #4906
or:

  1. Take any project with webpack (e.g. https://github.com/pmunin/handsontable)
  2. Put (or clone) it in any folder, with the name starting from “!” (exclamation mark)
  3. run webpack build (e.g. “npm run build:umd” for repo provided at step 1)

What is the expected behavior?
Webpack should at least provide a proper error message saying that user cannot have Exclamation marks in the path.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
OS: Windows 10 x64
node v6.3.1
npm v3.10.3
webpack v2.6.1

Author: Fantashit

1 thought on “Unclear error message in case of Exclamation mark in project path breaking the build on Windows

  1. I guess the reason for this restriction is module loader syntax (https://webpack.js.org/loaders/).
    E.g.: import Styles from 'style-loader!css-loader?modules!./styles.css'; Not the best design decision, but at least they could provide a message for that so people don’t spend a day for finding this out.

Comments are closed.