Skip to content
New issue

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

Provider error when adding the vercelBlobStorage plugin. #11991

Open
hugoalvarenga opened this issue Apr 4, 2025 · 0 comments
Open

Provider error when adding the vercelBlobStorage plugin. #11991

hugoalvarenga opened this issue Apr 4, 2025 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@hugoalvarenga
Copy link

hugoalvarenga commented Apr 4, 2025

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:

Image

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

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
@hugoalvarenga hugoalvarenga added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Apr 4, 2025
@github-actions github-actions bot removed the validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. label Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant