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

[Bug]: Rspress is using readFile on subdirectories if prefixed with digits and dot #1682

Closed
XavierLeTohic opened this issue Dec 19, 2024 · 0 comments · Fixed by #1683
Closed
Labels
🐞 bug Something isn't working

Comments

@XavierLeTohic
Copy link

XavierLeTohic commented Dec 19, 2024

Version

System:
    OS: macOS 14.7.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 1.57 GB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 131.0.6778.140
    Safari: 17.6
  npmPackages:
    rspress: ^1.38.0 => 1.38.0

Details

When subdirectories are prefixed with digits and dots like docs/010.sub-directory/ or docs/010.sub-directory/008.second-sub-directory/ Rspress cashes because it tries to read it like a file.

Couldn't find a workaround and can't rename all directories due to conventions.

Repo to reproduce -> https://github.com/XavierLeTohic/rspress-read-directory-error-example

🔥 Rspress v1.38.0

node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

[Error: EISDIR: illegal operation on a directory, read] {
  errno: -21,
  code: 'EISDIR',
  syscall: 'read'
}

Node.js v22.11.0

Reproduce link

https://github.com/XavierLeTohic/rspress-read-directory-error-example

Reproduce Steps

Run nvm use or use Node 22.x
Run npm i
Run npm run dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant