question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack 5 can't set output path to `/`

See original GitHub issue

Bug 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:open
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sodateacommented, Mar 12, 2020

See the linked pull request.

memory-fs throws EEXIST, which webpack’s fs.mkdirp implementation could recognize. But BSD systems and memfs throws EISDIR. The refactored fs.mkdirp in webpack 5 couldn’t handle that error and fails.

0reactions
alexander-akaitcommented, Jan 31, 2021

Still valid

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found