Cannot read properties of undefined (reading 'includes') when using the Gmail trigger

I started getting the same error. Here is the error output:

​{
  "errorMessage": "Cannot read properties of undefined (reading 'includes')",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.78.0 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "TypeError: Cannot read properties of undefined (reading 'includes')",
      "    at PollContext.poll (/opt/render/project/src/packages/nodes-base/nodes/Google/Gmail/GmailTrigger.node.ts:312:35)",
      "    at processTicksAndRejections (node:internal/process/task_queues:105:5)",
      "    at WorkflowExecute.runNode (/opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:1122:20)",
      "    at /opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:1490:27",
      "    at /opt/render/project/src/packages/core/src/execution-engine/workflow-execute.ts:2051:11"
    ]
  }
}

I was using a Google Workspace email account. When I switched to a Gmail account (@gmail.com) it worked.

I tried changing various things and it started working again for me when I changed the settings on the Google Workspace trigger. I added a Filter for “Label Names or IDs” and set it to “Inbox”.

1 Like

I am facing similar error. I simply tried to get automatic email to my account when sheet gets a new entry or modification.
I am getting error: cannot read properties of undefined. If anyone knows to resolve this


, please reply.

I’m having a similar error, but mine seems to be related to a community node I installed https://www.npmjs.com/package/n8n-nodes-edit-image-plus. The node itself was outdated and didn’t work anymore, so I uninstalled it, however it looks like the uninstall hasn’t worked properly. The workflow still for some reason tries to access the deleted node.
I’m not getting any errors in any nodes only as a small popup in the corner of the screen and errors in the console.



I don’t know if this is different enough to warrant opening its own thread for it.

I am having the same issue. This was working and out of nowhere stopped working.

Giving the reading ‘includes’ error. Is there any permanent solution?

I’ve tried the above suggestions. Recreating the workflow, deleting the node and adding it back, recreating the credentials.

Same error :

TypeError: Cannot read properties of undefined (reading 'content') at ToolCallingAgentOutputParser._baseMessageToString (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/output_parsers/base.cjs:24:31) at ToolCallingAgentOutputParser._callWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/output_parsers/base.cjs:49:32) at ToolCallingAgentOutputParser._callWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:223:34) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ToolCallingAgentOutputParser._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:165:9) at ToolCallingAgentOutputParser.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at RunnableSequence._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:1320:30) at RunnableSequence.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at wrapInputForTracing (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:275:30) at pipeGeneratorWithSetup (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/stream.cjs:271:19)

My workflow :slight_smile:

EDIT : When i delete my gmail node, the model is running but for sure i cant have any action

I’m also having this problem - but only when using certain models to interpret the output. If I use GPT 3.5 to interpret the output I get the same error, but switching to GPT 4.0 or later and the error isn’t triggered and the node is executed successfully.

I am triggering the workflow via the gmail trigger, then extracting a summary of the email. 100% of the time when 3.5 Turbo is selected it errors, but switching the model to 4 Turbo and the node is successful 100% of the time.

Also using Community version 1.100.1