We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to integrate PayloadCMS with Vercel's Blob Storage, but when configuring the plugin, I get this error when accessing the admin:
https://github.com/hugoalvarenga/payload-cms-blob
`// storage-adapter-import-placeholder import { mongooseAdapter } from "@payloadcms/db-mongodb"; import { payloadCloudPlugin } from "@payloadcms/payload-cloud"; import { lexicalEditor } from "@payloadcms/richtext-lexical"; import { resendAdapter } from "@payloadcms/email-resend"; import { vercelBlobStorage } from "@payloadcms/storage-vercel-blob"; import path from "path"; import { buildConfig, PayloadRequest } from "payload"; import { fileURLToPath } from "url"; import sharp from "sharp"; import { seoPlugin } from "@payloadcms/plugin-seo"; import { GenerateTitle, GenerateURL } from "@payloadcms/plugin-seo/types"; import { Users } from "./cms/collections/Users"; import { Media } from "./cms/collections/Media"; import { Posts } from "./cms/collections/Posts"; import { Categories } from "./cms/collections/Categories"; import { Post } from "./payload-types"; import { getServerSideURL } from "./cms/utilities/getURL";
const generateTitle: GenerateTitle = ({ doc }) => { return doc?.title ? ${doc.title} - Lomadee : "Lomadee"; };
${doc.title} - Lomadee
const generateURL: GenerateURL = ({ doc }) => { const url = getServerSideURL();
return doc?.slug ? ${url}/${doc.slug} : url; };
${url}/${doc.slug}
const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); const normalizedPath = path.posix.join( dirname.split(path.sep).join(path.posix.sep), "cms", "admin" );
export default buildConfig({ admin: { user: Users.slug, importMap: { baseDir: normalizedPath, importMapFile: path.resolve(dirname, "app", "importMap.js"), }, }, localization: { defaultLocale: "pt-BR", locales: ["pt-BR", "en", "es"], }, collections: [Users, Media, Posts, Categories], editor: lexicalEditor(), secret: process.env.PAYLOAD_SECRET || "", typescript: { outputFile: path.resolve(dirname, "payload-types.ts"), }, db: mongooseAdapter({ url: process.env.DATABASE_URI || "", }), sharp, plugins: [ payloadCloudPlugin(), seoPlugin({ generateTitle, generateURL, }), vercelBlobStorage({ enabled: true, collections: { media: true, }, token: process.env.BLOB_READ_WRITE_TOKEN, }), ], globals: [], email: resendAdapter({ defaultFromAddress: "info@lomadee.com", defaultFromName: "Lomadee", apiKey: process.env.RESEND_API_KEY || "", }), });`
plugin: other
Binaries: Node: 20.15.0 npm: N/A Yarn: N/A pnpm: N/A Relevant Packages: payload: 3.32.0 Operating System: Platform: win32 Arch: x64 Version: Windows 11 Pro Available memory (MB): 64662 Available CPU cores: 24
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the Bug
I am trying to integrate PayloadCMS with Vercel's Blob Storage, but when configuring the plugin, I get this error when accessing the admin:
Link to the code that reproduces this issue
https://github.com/hugoalvarenga/payload-cms-blob
Reproduction Steps
`// storage-adapter-import-placeholder
import { mongooseAdapter } from "@payloadcms/db-mongodb";
import { payloadCloudPlugin } from "@payloadcms/payload-cloud";
import { lexicalEditor } from "@payloadcms/richtext-lexical";
import { resendAdapter } from "@payloadcms/email-resend";
import { vercelBlobStorage } from "@payloadcms/storage-vercel-blob";
import path from "path";
import { buildConfig, PayloadRequest } from "payload";
import { fileURLToPath } from "url";
import sharp from "sharp";
import { seoPlugin } from "@payloadcms/plugin-seo";
import { GenerateTitle, GenerateURL } from "@payloadcms/plugin-seo/types";
import { Users } from "./cms/collections/Users";
import { Media } from "./cms/collections/Media";
import { Posts } from "./cms/collections/Posts";
import { Categories } from "./cms/collections/Categories";
import { Post } from "./payload-types";
import { getServerSideURL } from "./cms/utilities/getURL";
const generateTitle: GenerateTitle = ({ doc }) => {
return doc?.title ?
${doc.title} - Lomadee
: "Lomadee";};
const generateURL: GenerateURL = ({ doc }) => {
const url = getServerSideURL();
return doc?.slug ?
${url}/${doc.slug}
: url;};
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
const normalizedPath = path.posix.join(
dirname.split(path.sep).join(path.posix.sep),
"cms",
"admin"
);
export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: normalizedPath,
importMapFile: path.resolve(dirname, "app", "importMap.js"),
},
},
localization: {
defaultLocale: "pt-BR",
locales: ["pt-BR", "en", "es"],
},
collections: [Users, Media, Posts, Categories],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || "",
typescript: {
outputFile: path.resolve(dirname, "payload-types.ts"),
},
db: mongooseAdapter({
url: process.env.DATABASE_URI || "",
}),
sharp,
plugins: [
payloadCloudPlugin(),
seoPlugin({
generateTitle,
generateURL,
}),
vercelBlobStorage({
enabled: true,
collections: {
media: true,
},
token: process.env.BLOB_READ_WRITE_TOKEN,
}),
],
globals: [],
email: resendAdapter({
defaultFromAddress: "info@lomadee.com",
defaultFromName: "Lomadee",
apiKey: process.env.RESEND_API_KEY || "",
}),
});`
Which area(s) are affected? (Select all that apply)
plugin: other
Environment Info
The text was updated successfully, but these errors were encountered: