Uploadthing Uploader Doesn't work
Describe the Bug
This is Uploadthing configuration for me.
` uploadthingStorage({ enabled: true,
collections: {
media: true,
},
options: {
token: process.env.UPLOADTHING_TOKEN,
acl: 'public-read',
defaultKeyType: 'customId',
logLevel:'All',
},
}),`
But it doesn't upload to the Uploadthing server.
Link to the code that reproduces this issue
https://github.com/naimulemon/riivstudio
Reproduction Steps
- pnpm i && pnpm run dev
- Install the uploadthing plugin on config
- Try to upload uploadthing image uploader
Which area(s) are affected? (Select all that apply)
plugin: cloud-storage
Environment Info
Node: 22.3.0
npm: 10.8.1
Yarn: N/A
pnpm: 9.3.0
Relevant Packages:
payload: 3.1.1
next: 15.0.3
@payloadcms/db-postgres: 3.1.1
@payloadcms/email-nodemailer: 3.1.1
@payloadcms/graphql: 3.1.1
@payloadcms/live-preview: 3.1.1
@payloadcms/live-preview-react: 3.1.1
@payloadcms/next/utilities: 3.1.1
@payloadcms/payload-cloud: 3.1.1
@payloadcms/plugin-cloud-storage: 3.2.1
@payloadcms/plugin-form-builder: 3.1.1
@payloadcms/plugin-nested-docs: 3.1.1
@payloadcms/plugin-redirects: 3.1.1
@payloadcms/plugin-search: 3.1.1
@payloadcms/plugin-seo: 3.1.1
@payloadcms/richtext-lexical: 3.1.1
@payloadcms/storage-uploadthing: 3.2.1
@payloadcms/storage-vercel-blob: 3.2.1
@payloadcms/translations: 3.1.1
@payloadcms/ui/shared: 3.1.1
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020
Please add a reproduction in order for us to be able to investigate.
Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.
Why was this issue marked with the invalid-reproduction label?
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).
To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.
Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.
I added a link, why was it still marked?
Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.
Useful Resources
This package constantly stops working for me and finally I get to see one reason why.
[22:59:51] ERROR: Cannot execute an Effect versioned 3.11.5 with a Runtime of version 3.10.3
err: {
"type": "FiberFailureImpl",
"message": "Cannot execute an Effect versioned 3.11.5 with a Runtime of version 3.10.3",
"stack":
RuntimeException: Cannot execute an Effect versioned 3.11.5 with a Runtime of version 3.10.3
at rsc)/./node_modules/.pnpm/[email protected]/node_modules/effect/dist/esm/internal/core.js:615:109
"name": "(FiberFailure) RuntimeException"
}
Usually I don't see this error though, I had to monkey patch throw error here to be able to get it. https://github.com/payloadcms/payload/blob/main/packages/storage-uploadthing/src/handleUpload.ts#L54
Now I can fix it but having no throw there seems to be something that would have helped me multiple times in the past when debugging uploadthing upstream issues.
Hey @robclancy,
How did you fix it? I'am having something similar but on production only. Works fine locally but failed on production with error: [36mUnexpected error in staticHandler[39m err: { "type": "Sx", "message": "Cannot execute an Effect versioned 3.12.0 with a Runtime of version 3.10.3", "stack": RuntimeException: Cannot execute an Effect versioned 3.12.0 with a Runtime of version 3.10.3 at /var/task/.next/server/chunks/6232.js:321:6027 "name": "(FiberFailure) RuntimeException" }. Thank you in advance.
Hey @robclancy,
How did you fix it? I'am having something similar but on production only. Works fine locally but failed on production with error:
[36mUnexpected error in staticHandler�[39m err: { "type": "Sx", "message": "Cannot execute an Effect versioned 3.12.0 with a Runtime of version 3.10.3", "stack": RuntimeException: Cannot execute an Effect versioned 3.12.0 with a Runtime of version 3.10.3 at /var/task/.next/server/chunks/6232.js:321:6027 "name": "(FiberFailure) RuntimeException" }. Thank you in advance.
We had uploadthing in our package.json for our import tools so it was installing one version while payload installed another. We fixed it by setting the direct dependency to * which meant it just used the once payload enforced. We also have had various other issues with the uploadthing api (and likely will migrate away in general, it's just not stable enough) and some of them were fixed by changing node version.
I basically did a bunch of pnpm why uploadthing I think to find where things were.