You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2025. It is now read-only.
I'm working on a plugin that adds a new collection with a few fields and hooks. Hot reload is working perfectly when I add new fields to the new collection—they instantly show up on the dashboard. But if I had new collection hooks, the changes aren't captured. I have to stop and restart the server for changes to the collection's hooks to be picked up.
I tried both anonymous inline functions in beforeChange
hooks: {beforeChange: [()=>{console.log('only shows up after manually restarting server')}]}
and importing the hook from a separate file like in the docs:
import{CollectionBeforeChangeHook}from"payload/types";constbeforeChangeHook: CollectionBeforeChangeHook=async({})=>{console.log('still only shows up after manually restarting server');};exportdefaultbeforeChangeHook;
Any thoughts on why hooks might be cached or not captured, or if I might have something wrong in my set-up?
The collection is being added per the example: