Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sodatea opened this issue Mar 12, 2020 · 2 comments · May be fixed by #10545
Open

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

sodatea opened this issue Mar 12, 2020 · 2 comments · May be fixed by #10545

Comments

@sodatea
Copy link
Contributor

@sodatea sodatea commented Mar 12, 2020

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

sodatea added a commit to sodatea/webpack that referenced this issue Mar 12, 2020
Fixes webpack#10544.

Though the `EISDIR` error code is not mentioned in the POSIX standard,
FreeBSD and memfs both throws this error when trying to run `mkdir` on
`/`. So essentially we should treat it the same as `EEXIST`.

References:
* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=59739
* streamich/memfs#326
@sodatea sodatea linked a pull request that will close this issue Mar 12, 2020
@evilebottnawi

This comment has been minimized.

Copy link
Member

@evilebottnawi evilebottnawi commented Mar 12, 2020

Yep, memory-fs for dev server also has that limitation, what is use case?

@sodatea

This comment has been minimized.

Copy link
Contributor Author

@sodatea sodatea commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.