Skip to content

Possible safe-action response issue when creating Gmail filters #871

@Helmi

Description

@Helmi

Hey there, I bumped into a small oddity in the Bulk Unsubscribe flow.

When I hit "Label future emails," the action runs server-side, but the UI stays silent and I get this in the console:

Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.
{ data: Response }

It looks like createFilterAction returns the raw Gaxios Response, which next-safe-action doesn’t love. When I change it to send back a plain { status }, everything starts working again:

const res = await emailProvider.createFilter({ from, addLabelIds: [gmailLabelId] });
if (!isStatusOk(res.status)) throw new SafeError("Failed to create filter");
return { status: res.status };

Happy to PR this if that’s the right fix—or let me know if I’m missing something obvious! Thanks 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions