Payload doesn't want to generate types
Unanswered
Rhinelander posted this in #help-forum
RhinelanderOP
Hey, I am using payload and I try to add new collection called "posts"
It is just copy pasted default Media collection with changed slug and component name
When I try to query posts from Payload i get error that "posts" is not assignable to collection
As far as I know Payload auto generates types??? I tried
import type { CollectionConfig } from "payload";
export const Posts: CollectionConfig = {
slug: "posts",
access: {
read: () => true,
},
fields: [
{
name: "alt",
type: "text",
required: true,
},
],
upload: true,
};
It is just copy pasted default Media collection with changed slug and component name
When I try to query posts from Payload i get error that "posts" is not assignable to collection
const payload = await getPayload({ config });
const posts = payload.find({
collection: "posts",
});
As far as I know Payload auto generates types??? I tried
pnpx payload generate:types
and i get error that it can not find module called Media (it is there by default when I installed Payload) -> imported as other stuffimport { Media } from "./collections/Media";
import { Posts } from "./collections/Posts";
import { Users } from "./collections/Users";