The below code expects a selector... if no selector is used, an error is thrown.
const state = useSyncExternalStore(store.subscribe, () => selector(store.get()));
This can be fixed be just returning setting the getter to store.get when no selector is passed. Some like below.
const getter = selector ? () => selector(store.get()) : store.get;
const state = useSyncExternalStore(store.subscribe, getter);