melishev / strapi-plugin-react-editorjs

📝 Plugin for Strapi Headless CMS, hiding the standard WYSIWYG editor on Editor.js
https://www.npmjs.com/package/strapi-plugin-react-editorjs
MIT License
171 stars 80 forks source link

Beta - Strapi v4: Mailgun causes the link tool to fail #25

Open jaskipper opened 2 years ago

jaskipper commented 2 years ago

When @strapi/provider-email-mailgun is installed in Strapi, it causes the link tool to fail. The link controller is using open-graph-scraper, which uses got, and this is where the failure occurs. This is a known issue with got when mailgun is installed. See https://github.com/panva/node-openid-client/issues/320#issuecomment-764416863. Not sure if we should leave this as is and give users the warning, or maybe try using a different tool other than open-graph-scraper to scrape the data.

When printing out the response from server/controllers/editorjs.js link, I get this response:

{
  success: false,
  requestUrl: 'http://strapi.io',
  error: 'connect ECONNREFUSED 127.0.0.1:443',
  errorDetails: RequestError: connect ECONNREFUSED 127.0.0.1:443
      at ClientRequest.<anonymous> (/Volumes/Work/Web/strapi-v4/src/plugins/strapi-plugin-react-editorjs/node_modules/got/dist/source/core/index.js:962:111)
      at Object.onceWrapper (events.js:482:26)
      at ClientRequest.emit (events.js:387:35)
      at ClientRequest.emit (domain.js:470:12)
      at ClientRequest.origin.emit (/Volumes/Work/Web/strapi-v4/src/plugins/strapi-plugin-react-editorjs/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
      at TLSSocket.socketErrorListener (_http_client.js:475:9)
      at TLSSocket.emit (events.js:375:28)
      at TLSSocket.emit (domain.js:470:12)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:82:21)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
    code: 'ECONNREFUSED',
    timings: {
      start: 1645892688824,
      socket: 1645892688825,
      lookup: 1645892688825,
      connect: undefined,
      secureConnect: undefined,
      upload: undefined,
      response: undefined,
      end: undefined,
      error: 1645892688825,
      abort: undefined,
      phases: [Object]
    }
  }
}
melishev commented 2 years ago

@jaskipper - I think that since this problem is related to MailGun, it would be nice to get a response from the developers first

jaskipper commented 2 years ago

@melishev - It absolutely is a problem related to MailGun. MailgunJS is deprecated. Unfortunately the plugin seems to take everything over and it breaks the link tool. I've tried to find a workaround, but had no luck up to this point.