Cannot read properties of undefined (reading 'error') In Level 2 course. Discord Node

I am trying to send a message in Leve2(Workflow 2) course webhook node(Discord). Since Gmail Auth won't accept localhost as trusted url. I am skipping the Gmail node and directly connecting to Discord node from "Convet to file". When I execute the flow I am getting a error "Cannot read properties of undefined (reading 'error').....

Full error:
{
“errorMessage”: “Cannot read properties of undefined (reading ‘error’)”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “1.106.3 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“TypeError: Cannot read properties of undefined (reading ‘error’)”,
" at ExecuteContext.parseDiscordError (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/helpers/utils.ts:32:30)“,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/actions/webhook/sendLegacy.operation.ts:153:34)”,
" at processTicksAndRejections (node:internal/process/task_queues:105:5)“,
" at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/actions/router.ts:70:17)”,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/DiscordV2.node.ts:33:10)“,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1212:9)”,
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1582:27",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_0c275070fd0434c00ffd62213b2bcae4/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2158:11"
]
}
}

Cannot read properties of undefined (reading ‘error’)

Please share your workflow

(Select the n{
  "name": "Generating Reports",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -272,
        0
      ],
      "id": "8f407469-352c-4338-84dd-8fbfec52e9df",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "url": "https://internal.users.n8n.cloud/webhook/level2-erp",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "unique_id",
              "value": "1bf3fe5cbfe9983c989767ab9000c60f"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -64,
        -112
      ],
      "id": "e9274181-4e12-42fe-9721-5066b4e79544",
      "name": "HTTP Request",
      "credentials": {
        "httpHeaderAuth": {
          "id": "1IZgy5Auuulv9sFz",
          "name": "Header Auth account"
        }
      }
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "appiGrdtvTBHYHPGn",
          "mode": "list",
          "cachedResultName": "Basic_n8n",
          "cachedResultUrl": "https://airtable.com/appiGrdtvTBHYHPGn"
        },
        "table": {
          "__rl": true,
          "value": "tblqRTEVrrqGtIV4q",
          "mode": "list",
          "cachedResultName": "customer",
          "cachedResultUrl": "https://airtable.com/appiGrdtvTBHYHPGn/tblqRTEVrrqGtIV4q"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        -64,
        112
      ],
      "id": "94c2d984-da6c-4489-83b5-b9cd3bde3d95",
      "name": "Search records",
      "credentials": {
        "airtableTokenApi": {
          "id": "w1sGPahLj62d6snG",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "fieldsToMatchString": "=customerID",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        144,
        -48
      ],
      "id": "5ce44f1a-97c2-4ddb-9664-c0a90d365172",
      "name": "Merge"
    },
    {
      "parameters": {
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "=orderPrice",
              "order": "descending"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.sort",
      "typeVersion": 1,
      "position": [
        352,
        -48
      ],
      "id": "a6084b02-3359-4e7d-844e-3425c5f3e4be",
      "name": "Sort"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "374c8f03-7cda-44e6-9f67-ad3574dbf5e3",
              "leftValue": "={{ $json.region }}",
              "rightValue": "Americas",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        512,
        -160
      ],
      "id": "75af824b-dc24-458b-a32c-220a5b1ced62",
      "name": "If"
    },
    {
      "parameters": {
        "operation": "toJson",
        "mode": "each",
        "binaryPropertyName": "==report_orderID_{{ $('If').item.json.orderID }}.json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        848,
        -192
      ],
      "id": "d33d8c73-4e42-492e-9c9f-87af52a1ed3e",
      "name": "Convert to File"
    },
    {
      "parameters": {
        "authentication": "webhook",
        "content": "=I sent the file using email with the label ID. My ID: 1bf3fe5cbfe9983c989767ab9000c60f",
        "options": {}
      },
      "type": "n8n-nodes-base.discord",
      "typeVersion": 2,
      "position": [
        1056,
        -224
      ],
      "id": "ecf8ac85-bdde-493f-93b5-db30f58b03ad",
      "name": "Discord",
      "webhookId": "92e389aa-5c12-42a3-b0c7-5fbcf25caaee",
      "credentials": {
        "discordWebhookApi": {
          "id": "knHu0wxK3k4avdPw",
          "name": "Discord Webhook account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Sort",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "520dc5cf-2948-4a19-986c-5c1df7e84b50",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "783bc9a8206c092006f19ea5e47550d34ffee28dca1a32314515b0b5133ba76c"
  },
  "id": "BHla32GPIUnhHDSr",
  "tags": []
}odes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: Version 1.106.3
  • Database (default: SQLite): sql lite.
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 11

Hi @Rohith welcome to the :n8n: community!

For the n8n Course Level 2, please follow this structure in the Message box:

I sent the file using email with the label ID order21 . My ID: <your Unique ID>


If this resolves your issue, please like :heart: and mark the reply as the solution :white_check_mark:, Thanks!

I am having a similar problem with “Part 3: Generating files for total sales”. The Convert to File node outputs a binary object with no fields, so if I implement it as in the course description I get the same error: “Cannot read properties of undefined (reading ‘error’)”

I tried copying the code at the end of this URL Workflow 2 | n8n Docs and I verified that it produces the error.

I’m not 100% sure but this seems to be related: Issue with Convert to File and Code Nodes Returning Empty Binary Output in n8n 1.81.4 + Workflow Goal Explanation - #2 by lugnicca