yinkakun / medusa-file-r2

13 stars 2 forks source link

I followed the instructions Precisely and added everything tried yarn & also Tried using npm but It says, "unable to find the plugin". When I start the dev Server. #7

Open abdurrobbadhon opened 1 week ago

abdurrobbadhon commented 1 week ago
➜  learning-medusa git:(master) ✗ yarn medusa develop
yarn run v1.22.22
warning ../../../../package.json: No license field
$ /Users/abd607/Documents/shop/backend/learning-medusa/node_modules/.bin/medusa develop
info:    Watching filesystem to reload dev server on file change
info:    Skipping instrumentation registration. No register function found.
error:   Error starting server
error:   Unable to find the plugin "medusa-file-r2".
Error: Unable to find the plugin "medusa-file-r2".

my config file:

import { loadEnv, defineConfig } from '@medusajs/framework/utils'

loadEnv(process.env.NODE_ENV || 'development', process.cwd())

module.exports = defineConfig({
  projectConfig: {
    databaseUrl: process.env.DATABASE_URL,
    redisUrl: process.env.REDIS_URL,
    http: {
      storeCors: process.env.STORE_CORS!,
      adminCors: process.env.ADMIN_CORS!,
      authCors: process.env.AUTH_CORS!,
      jwtSecret: process.env.JWT_SECRET || "supersecret",
      cookieSecret: process.env.COOKIE_SECRET || "supersecret",
    }
  },
  plugins: [
    {
      resolve: 'medusa-file-r2',
      options: {
        account_id: process.env.R2_ACCOUNT_ID,
        access_key: process.env.R2_ACCESS_KEY,
        secret_key: process.env.R2_SECRET_KEY,
        bucket: process.env.R2_BUCKET,
        public_url: process.env.R2_PUBLIC_URL
      },
    }
  ]
})