Make vite-plugin-content-virtual-mod run getEntrySlug 10 at a time#7125
Make vite-plugin-content-virtual-mod run getEntrySlug 10 at a time#7125
getEntrySlug 10 at a time#7125Conversation
🦋 Changeset detectedLatest commit: 3d09c0c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ematipico
left a comment
There was a problem hiding this comment.
The code looks good. Should we make a preview release and ask users to test it to make sure that this is the correct fix?
|
!preview content-serial |
|
|
!preview content-serial |
|
getEntrySlug seriallygetEntrySlug 10 at a time
|
I wonder if the issue isn't the watcher at all... since the error says "too many open files", maybe we should use try to use |
|
I think the nodejs APIs we use to read files doesn't get the file handle, so it's automatically closed by default. But it can definitely be the watcher still causing issues. Maybe we could share the same Vite server's watcher for type generation? Could be that we have two watchers that's causing the problem 🤔 I'll go ahead and merge this first to unblock some users' setups. |
Changes
Fix #7073
Make vite-plugin-content-virtual-mod run
getEntrySlugserially as it reads the filesystem. Running in parallel all at once could cause the OS to lock reading files.Testing
Manually tested with docs to see if there's a first-page load slowdown. I didn't notice a big difference so this should be good.
Docs
n/a. bug fix.