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

"Functions cannot be passed directly to Client Components" when trying to use cloudStorage #8762

Closed
jonathanelmgren opened this issue Oct 17, 2024 · 3 comments

Comments

@jonathanelmgren
Copy link

Describe the Bug

Hi I'm getting:

Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  {avatar: ..., components: {}, custom: ..., dateFormat: ..., dependencies: ..., disable: ..., importMap: ..., meta: ..., routes: ..., theme: ..., user: ..., webpack: function}
  ^^^^^^^^                                                                                                                                                                     

When I'm trying to use cloudStorage from @payloadcms/plugin-cloud-storage. No matter what adapter I use.

Link to the code that reproduces this issue

https://github.com/jonathanelmgren/payload-cms-pcs

Reproduction Steps

  1. Clone repo
  2. Start dev server
  3. Try go to /admin

Which area(s) are affected? (Select all that apply)

plugin: cloud-storage, db-postgres

Environment Info

Binaries:
Node: 20.17.0
npm: 10.8.2
Yarn: 1.22.19
pnpm: 9.7.1
Relevant Packages:
payload: 3.0.0-beta.116
next: 15.0.0-canary.173
@payloadcms/db-postgres: 3.0.0-beta.116
@payloadcms/email-nodemailer: 3.0.0-beta.116
@payloadcms/graphql: 3.0.0-beta.116
@payloadcms/next/utilities: 3.0.0-beta.116
@payloadcms/plugin-cloud: 3.0.0-beta.116
@payloadcms/plugin-cloud-storage: 1.2.0
@payloadcms/richtext-lexical: 3.0.0-beta.116
@payloadcms/translations: 3.0.0-beta.116
@payloadcms/ui/shared: 3.0.0-beta.116
react: 19.0.0-rc-3edc000d-20240926
react-dom: 19.0.0-rc-3edc000d-20240926
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10

@jonathanelmgren jonathanelmgren added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 17, 2024
@akhrarovsaid
Copy link
Contributor

akhrarovsaid commented Oct 17, 2024

Hey @jonathanelmgren,

Thanks for the reproduction! It seems like you're trying to use the cloud storage plugin for v2 yet are using Payload v3. Can you try installing the beta version of the cloud storage plugin?

@paulpopus
Copy link
Contributor

As above, you can see a list of our beta adapters https://payloadcms.com/docs/beta/upload/storage-adapters#s3-storage

In v3 beta we moved away from one package to having specific adapters and their beta version should always match with the installed payload version.

@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 17, 2024
Copy link
Contributor

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants