hi! i just installed payload using create-payload-app in a pnpm turborepo/monorepo, added a new collection:
import type { CollectionConfig } from "payload/types";
export const Pages: CollectionConfig = {
slug: "pages",
fields: [
{
name: "title",
label: "Title",
type: "text",
required: true,
},
{
name: "body",
label: "Body",
type: "richText",
required: true,
},
],
};
and added it to my config file:
import path from "path";
import { webpackBundler } from "@payloadcms/bundler-webpack";
import { mongooseAdapter } from "@payloadcms/db-mongodb";
import { payloadCloud } from "@payloadcms/plugin-cloud";
import { lexicalEditor } from "@payloadcms/richtext-lexical";
import { buildConfig } from "payload/config";
import { Pages } from "./collections/Pages";
import Users from "./collections/Users";
export default buildConfig({
admin: {
user: Users.slug,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
bundler: webpackBundler(),
},
editor: lexicalEditor({}),
collections: [Users, Pages],
typescript: {
outputFile: path.resolve(__dirname, "payload-types.ts"),
},
graphQL: {
schemaOutputFile: path.resolve(__dirname, "generated-schema.graphql"),
},
plugins: [payloadCloud()],
db: mongooseAdapter({
url: process.env.DATABASE_URI ?? "",
}),
});
and when visiting
/admin/collections/pages/create
, the page goes blank and the following errors pop in the browser console:
I'm also using the new Lexical editor, if that helps. i have no data or no other configuration in the app so far except for that.
am i doing something wrong? i've reread the Lexical documentation multiple times, but maybe i missed something :/
turns out having
node-linker=hoisted
in
.npmrc
was the culprit.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.