Describe the problem/error/question
When using the Default Data Loader node to load a PDF binary file, the execution fails with the following error:
"errorMessage": "DOMMatrix is not defined",
"errorDescription": "DOMMatrix is not defined"
The following warnings are also logged in the container:
Warning: Cannot load "@napi-rs/canvas" package: "Error: Failed to load native binding".
Warning: Cannot polyfill `DOMMatrix`, rendering may be broken.
Warning: Cannot polyfill `ImageData`, rendering may be broken.
Warning: Cannot polyfill `Path2D`, rendering may be broken.
Steps to reproduce
- Set up a workflow with a PDF binary source (e.g. Google Drive, Webhook, Form node).
- Connect the binary output to a Default Data Loader node with Type of Data set to
Binary. - Execute the workflow.
Expected behavior
The Default Data Loader should successfully parse the PDF and pass the content downstream.
Actual behavior
The node fails with DOMMatrix is not defined. The @napi-rs/canvas package cannot be loaded, preventing pdfjs-dist from polyfilling the required browser-native APIs.
Information on my n8n setup
- n8n version: 2.25.7 (Self Hosted)
- Running n8n via: Docker
- Binary data mode: filesystem
Additional context
This issue appears to have been introduced in v1.98.0 when pdfjs-dist was upgraded to a version that depends on browser-native APIs not available in Node.js server environments. It has been reported by multiple users in previous versions and seems to persist in v2.25.7.
What is the error message (if any)?
Please share your 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: