[Solution/Workaround] "DOMMatrix is not defined" error in Extract from File (PDF) Node on n8n v1.98.0+

Describe the problem/error/question

Hello, I want to share a definitive root cause and a stable workaround for the persistent DOMMatrix is not defined error. This issue affects the Extract from File node when processing PDFs on self-hosted instances. The problem started exactly in n8n version 1.98.0 and continues in newer versions like 1.99.0.

What is the error message (if any)?

DOMMatrix is not defined

Please share your workflow

The problem is not with any specific workflow, but with the n8n version itself. After a deep investigation, we found the root cause:

Root Cause:
In n8n version 1.98.0, the pdfjs-dist dependency was upgraded to a new major version (~5.3.31). This new version requires browser-native APIs (like DOMMatrix), which are not available in server-side environments like Docker. This is why the error started exactly at that version.


The Solution / Workaround

The only stable and reliable solution right now is to downgrade and pin your n8n version to 1.97.1.

For Docker users, use the image tag: n8n.io/n8nio/n8n:1.97.1

This version uses an older pdfjs-dist library that does not have this browser-dependency issue.

Important consideration: By downgrading to 1.97.1, you might re-introduce other bugs that were fixed in v1.98.0. In my case, another node (Information Extractor) which worked in v1.98.0 started failing in v1.97.1. I was able to solve that specific issue by changing its internal settings (switching to a different LLM model). Be aware that you might be trading one problem for another, but the PDF extraction issue is often a more critical blocker.

(Select the nodes 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

The node fails completely and does not return a data output, only the error message mentioned above.

Information on your n8n setup

  • **n8n version:1.97.1
  • **Database (default: SQLite):Postgres
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker (via Coolify)
  • **Operating system:Ubuntu 24.04.2 LTS
1 Like

Hi @Cesar_J_Garrido_Pere,

Thank you so much for your detailed investigation and for sharing the root cause of this issue. It’s incredibly helpful for the community.

I wanted to confirm that I am experiencing the exact same DOMMatrix is not defined error . Your analysis seems spot on.

My setup is a self-hosted instance running n8n v1.98.2 on Windows (via npm) , which confirms that the problem is not limited to Docker environments but seems to be a general issue in the n8n core since version 1.98.0.

While downgrading to 1.97.1 is a great temporary workaround, this feels like a significant regression for a core feature like PDF extraction. Pinning to an older version isn’t a sustainable long-term solution, as we would miss out on important security updates and new features.

It would be fantastic if a member of the @n8n-team could acknowledge this bug. Is a permanent fix on the roadmap for an upcoming release? A stable, built-in PDF extraction is a crucial function for many workflows.

Thanks again for pinpointing the source of the problem! Your efforts are much appreciated.

2 Likes

Hola, ya probé con la versión 1.100.1 y esta solucionado el error “DOMMatrix no está definido”, a usar todo el potencial de N8N, saludos

1 Like

Hello, I already tried version 1.100.1 and the “DOMMatrix is ​​not defined” error is fixed. Let’s use the full potential of N8N. Regards

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.