webpack 5 can't set output path to `/`
See original GitHub issueBug report
What is the current behavior?
When the output.path is set to /, webpack 5 will fail with an EISDIR error. It works in webpack 4.
/ is commonly used when targeting an in-memory filesystem such as https://github.com/streamich/memfs; we used it quite often in tests.
If the current behavior is a bug, please provide the steps to reproduce.
git clone https://github.com/sodatea/webpack-rootdir-bug.git
cd webpack-rootdir-bug
yarn && yarn build
What is the expected behavior?
Should successfully build.
Other relevant information: webpack version: v5.0.0-beta.14 Node.js version: v12.16.1 Operating System: macOS Catalina 10.15.3 Additional tools: None
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Output - webpack
The bundle is written to the directory specified by the output.path option. For a single entry point, this can be a static name....
Read more >Getting "Error: `output.path` needs to be an absolute path or `/`"
As the error message says, you need to use absolute path. To get an absolute path for current directory, You can use __dirname...
Read more >Webpack 5 Full Project Setup - YouTube
We'll start out creating a new Webpack 5 project, putting it on Github ... with html-webpack-plugin - Cleaning the output folder every build ......
Read more >'Path' cannot work on the webpack latest version. - Treehouse
configuration object. Webpack has been initialised using a configuration object that does not match the API schema. ·.output. · ERR! Darwin 15.6.
Read more >webpack Tutorial: How to Set Up webpack 5 From Scratch
Content. What is webpack; Installation; Basic configuration. Entry; Output. Plugins. HTML template; Clean. Modules and Loaders.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

See the linked pull request.
memory-fsthrowsEEXIST, which webpack’sfs.mkdirpimplementation could recognize. But BSD systems andmemfsthrowsEISDIR. The refactoredfs.mkdirpin webpack 5 couldn’t handle that error and fails.Still valid