Unclear error message in case of Exclamation mark in project path breaking the build on Windows
See original GitHub issueDo 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:
- Take any project with webpack (e.g. https://github.com/pmunin/handsontable)
- Put (or clone) it in any folder, with the name starting from “!” (exclamation mark)
- 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
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
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.+1
I just lost hours of work trying to figure why nuxt wouldn’t work only to find it was an exclamation mark in my Windows path. I do this all the time - it places my folders higher up the folder list. Please would you consider removing this restriction?
Cheers, Simon