Getting "DOMMatrix is not defined" error in Extract from PDF node

Describe the problem/error/question

Im using HTTP request node to get a PDF file and then using Extract from file node to extract the data from the PDF file. This was all working fine before, but now i’m getting a “DOMMatrix is not defined” error. When testing the workflow, the output from the HTTP request node is good (i see the binary file, I can download it and its a normal PDF file).

I did update our n8n workspace this morning to [email protected], not sure if that is the problem.

What is the error message (if any)?

{
  "errorMessage": "DOMMatrix is not defined",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "Extract from File1",
    "nodeType": "n8n-nodes-base.extractFromFile",
    "nodeVersion": 1,
    "operation": "pdf",
    "itemIndex": 0,
    "time": "17/06/2025, 09:37:25",
    "n8nVersion": "1.98.1 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeOperationError: DOMMatrix is not defined",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Files/ExtractFromFile/actions/pdf.operation.ts:134:10)",
      "    at processTicksAndRejections (node:internal/process/task_queues:105:5)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_12b981d6b49d407a163f4d5244314033/node_modules/n8n-nodes-base/nodes/Files/ExtractFromFile/ExtractFromFile.node.ts:130:17)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1185:9)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1534:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@[email protected][email protected][email protected]_/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2098:11"
    ]
  }
}

Please share your workflow

Information on your n8n setup

  • n8n version: [email protected]
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: mac os

Definitely a bug, you can report it here. Or let me know if you don’t want to, I’ll do it for you.

1 Like

Thanks, I’ve reported the bug

I’m getting the same error, any idea how to fix it?

It’s a bug. It has been reported and it’s being worked on. You can follow the progress here: PDF parsing broken in version 1.97.1 and up · Issue #16281 · n8n-io/n8n · GitHub

Same on v1.98.1 on Extract from PDF node – DOMMatrix is not defined.
FYI – convert to image and send to LLM for text.

Version 1.97.1 is working!

Same bug on 1.98.1

I think persist the bug…

facing the same problem on v1.98.1 on Extract from PDF node – DOMMatrix is not defined.

looks like there is a fix; need to wait to be incorporated to official.

This is the first time I’ve encountered a bug. Do you know how often this happens? How long does it take to fix it? Especially in the cloud version.

Rarely; check PDF parsing broken in version 1.97.1 and up · Issue #16281 · n8n-io/n8n · GitHub for updates and details why. As a temp measure convert pdf to image - might need PDF solution like self hosted stirling PDF and have cheap LLM like gemini 2.5flash-lite convert to markdown; you will get superior results esp PDF with graphics and tables.

Jeez been banging my head with this for over a week!! thought i had not set my server up properly