-
Hi, What's even more strange is that no error is encountered and the image is being correctly shown in the media list. I do not know from where, because it is not written do the disk. Maybe some cache? Thanks for any help import path from "path";
import type { CollectionConfig } from "payload/types";
export const Media: CollectionConfig = {
slug: "media",
upload: {
staticDir: path.resolve(__dirname, "..", "..", "files", "media"),
},
fields: [
{
name: "name",
type: "text",
},
],
}; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What is the error exactly? |
Beta Was this translation helpful? Give feedback.
Sorry, I have found the bug in the meanwhile. The problem was that in development, the media files were saved to
/files/media
, like shown in the example.However, when compiled to production, the project gets compiled to
dist
folder, so in the end, the Payload saves media files to/dist/files/media
. Silly error, but took a while to spot it.Thanks!