8000
Skip to content

fix(core): Fix pdf extract not working#16463

Merged
tomi merged 2 commits intomasterfrom
cat-956-community-issue-binary-files-broken-in-version-1980-next
Jun 18, 2025
Merged

fix(core): Fix pdf extract not working#16463
tomi merged 2 commits intomasterfrom
cat-956-community-issue-binary-files-broken-in-version-1980-next

Conversation

@tomi
Copy link
Copy Markdown
Collaborator
@tomi tomi commented Jun 18, 2025

Summary

Make sure patches are applied in Docker builds and optional deps are available.

This broke in combination of #14966 and #15729. The issue is:

Including optional dependencies increases the node_modules size from 915.5M to 1.0G

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-956/community-issue-binary-files-broken-in-version-1980-next

Fixes #16281

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@tomi tomi force-pushed the cat-956-community-issue-binary-files-broken-in-version-1980-next branch from 53586f6 to 1f568b5 Compare June 18, 2025 07:35
Make sure patches are applied in Docker builds and
optional deps are available.

This broke in combination of #14966 and #15729. The issue is:
- Patches were no longer applied because of an issue in #14966
- After #15729 optional dependencies are also required, which were removed in #14966

Fixes #16281
@tomi tomi force-pushed the cat-956-community-issue-binary-files-broken-in-version-1980-next branch from 1f568b5 to de32453 Compare June 18, 2025 07:38
@tomi tomi requested a review from shortstacked June 18, 2025 07:41
@codecov
Copy link
Copy Markdown
codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor
@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic reviewed 1 file and found no issues. Review PR in cubic.dev.

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Jun 18, 2025
netroy
netroy previously requested changes Jun 18, 2025
Copy link
Copy Markdown
Contributor
@netroy netroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was doing mostly the same in #16436

RUN NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --no-optional --legacy deploy /compiled
# We don't want to use --no-optional because pdfjs-dist has an optional dependency on
# @napi-rs/canvas, which is required for the pdfjs-dist package to work.
RUN NODE_ENV=production DOCKER_BUILD=true pnpm --filter=n8n --prod --legacy deploy /compiled
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested this? when I tried @napi/canvas did get installed, but failed to load because of missing binaries.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, and it did work after this. It seemed that the package was indeed missing. But the binary was also missing unless I specified linux/amd64 platform specifically. I can try and see if it's needed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay tested it with the --no-optional and it does not work. So we need to remove it

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator
@shortstacked shortstacked left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works when built for amd64.
One concern is the docker image size increase though.

@tomi tomi requested a review from netroy June 18, 2025 11:43
@netroy netroy dismissed their stale review June 18, 2025 12:23

already approved

@netroy netroy removed their request for review June 18, 2025 12:24
@tomi tomi merged commit c480d3c into master Jun 18, 2025
29 checks passed
@tomi tomi deleted the cat-956-community-issue-binary-files-broken-in-version-1980-next branch June 18, 2025 13:38
tomi added a commit that referenced this pull request Jun 18, 2025
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Jun 18, 2025
tomi added a commit that referenced this pull request Jun 18, 2025
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
This was referenced Jun 18, 2025
tomi added a commit that referenced this pull request Jun 18, 2025
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Jun 18, 2025
@janober
Copy link
Copy Markdown
Member
janober commented Jun 18, 2025

Got released with n8n@1.98.2

This was referenced Jun 19, 2025
dudanogueira pushed a commit to dudanogueira/n8n that referenced this pull request Jun 19, 2025
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <netroy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF parsing broken in version 1.97.1 and up

4 participants

0