错误:无法加载电子邮件提供程序 “sendgrid”

huangapple go评论56阅读模式
英文:

Error: Could not load email provider "sendgrid"

问题

以下是您要翻译的内容:

ms  | [2023-06-13 15:20:43.443] debug: ⛔️ Server wasn't able to start properly.
cms  | [2023-06-13 15:20:43.444] error: Could not load email provider "sendgrid".
cms  | Error: Could not load email provider "sendgrid".
cms  |     at createProvider (/opt/app/node_modules/@strapi/plugin-email/server/bootstrap.js:21:11)
cms  |     at Object.module.exports [as bootstrap] (/opt/app/node_modules/@strapi/plugin-email/server/bootstrap.js:29:37)
cms  |     at Object.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/core/domain/module/index.js:40:47)
cms  |     at Object.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/core/registries/modules.js:28:19)
cms  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
cms  |     at async Strapi.runLifecyclesFunctions (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:531:5)
cms  |     at async Strapi.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:469:5)
cms  |     at async Strapi.load (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:478:5)

获取上述错误:

  email: {
    config: {
      provider: "sendgrid",
      providerOptions: {
        apiKey: env("SENDGRID_API_KEY"),
      },
      settings: {
        defaultFrom: env("SENDGRID_FROM"),
        defaultReplyTo: env("SENDGRID_REPLY_TO"),
      },
    },
  },

....


    "@strapi/provider-email-sendgrid": "^4.11.1",
英文:
ms  | [2023-06-13 15:20:43.443] debug: ⛔️ Server wasn't able to start properly.
cms  | [2023-06-13 15:20:43.444] error: Could not load email provider "sendgrid".
cms  | Error: Could not load email provider "sendgrid".
cms  |     at createProvider (/opt/app/node_modules/@strapi/plugin-email/server/bootstrap.js:21:11)
cms  |     at Object.module.exports [as bootstrap] (/opt/app/node_modules/@strapi/plugin-email/server/bootstrap.js:29:37)
cms  |     at Object.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/core/domain/module/index.js:40:47)
cms  |     at Object.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/core/registries/modules.js:28:19)
cms  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
cms  |     at async Strapi.runLifecyclesFunctions (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:531:5)
cms  |     at async Strapi.bootstrap (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:469:5)
cms  |     at async Strapi.load (/opt/app/node_modules/@strapi/strapi/lib/Strapi.js:478:5)

Getting the above error:

  email: {
    config: {
      provider: "sendgrid",
      providerOptions: {
        apiKey: env("SENDGRID_API_KEY"),
      },
      settings: {
        defaultFrom: env("SENDGRID_FROM"),
        defaultReplyTo: env("SENDGRID_REPLY_TO"),
      },
    },
  },

....


    "@strapi/provider-email-sendgrid": "^4.11.1",

答案1

得分: 0

使用 docker-compose 时,如果没有映射卷 node_modules,安装新模块时必须添加 --build

对我来说,docker-compose up --build 解决了这个问题。

英文:

When using docker-compose if you don't have the volume node_modules mapped you have to add --build when you install a new module:

docker-compose up --build fixed it for me.

huangapple
  • 本文由 发表于 2023年6月15日 13:14:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76479307.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定