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

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(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

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Farman_Aliyev known regression — n8n’s Extract from File node uses pdfjs-dist which since 1.98 requires browser APIs like DOMMatrix that arent available in Node. multiple github issues open on it (#16593, #16438, #16422). workaround that works without downgrading: use a Code node with the pdf-parse npm package instead. set NODE_FUNCTION_ALLOW_EXTERNAL=pdf-parse in ur env vars, extract the text from binary in Code node, no browser API dependency. whats ur n8n version + self-hosted or cloud?

أهلاً وسهلاً @Farman_Aliyev!

achamm محق - هذا انحدار معروف. إليك عقدة Code محددة يمكنك إدراجها لاستبدال عقدة Extract from File:

const pdfParse = require('pdf-parse');
const binaryKey = Object.keys(items[0].binary)[0]; // gets the first binary field
const buffer = Buffer.from(items[0].binary[binaryKey].data, 'base64');
const result = await pdfParse(buffer);
return [{ json: { text: result.text } }];

أضف أيضاً NODE_FUNCTION_ALLOW_EXTERNAL=pdf-parse إلى متغيرات البيئة لديك أولاً. يعمل على كل من البيئات ذاتية الاستضافة والسحابية.

حدّث مثيل n8n الخاص بك (مستحسن)

تم الإبلاغ عن هذا الخلل في مجتمع n8n وخط أنابيب المطورين. إذا كنت تشغّل نسخة أقدم أو إصدار معطوب محدد من n8n، فإن التحديث إلى أحدث إصدار أو تثبيت صورة Docker الخاصة بك على أحدث إصدار مستقر عادة ما يحل المشكلة، حيث يتم دفع التصحيحات بسرعة لأعطال العُقد (النود) مثل هذا.

أخبرني إذا كان التحديث قد حل المشكلة.