Skip to content

Update bundle_size.mdx for excluding pdfjs-dist optional dependency docs #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/pages/common_issues/bundle_size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ eg: `--arch=arm64 --platform=linux --target=18 --libc=glibc`

##### pdfjs

If you need to use pdfjs, you should install it with `npm i pdfjs-dist--no-optional` because the optional dep: `canvas` takes about 180MB.
- If you need to use pdfjs, you should install it with `npm i pdfjs-dist--no-optional` because the optional dep: `canvas` takes about 180MB.

- If the above doesn't work (or gives some compilation errors) you can try:

```js
experimental: {
outputFileTracingExcludes: {
"*": ["node_modules/canvas"],
Copy link
Contributor

Choose a reason for hiding this comment

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

@revmischa was having build issues w/ the latest nextjs causing infinite loop. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

I filed an issue vercel/next.js#60301

Copy link
Contributor

Choose a reason for hiding this comment

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

People are reporting that updating sharp to v0.33.1 fixes this
Is this version specifier something that is inside open-next?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@abhimskywalker do you mind updating the sharp version to the latest 0.33.2 and see if that fixes the issues?
https://github.com/lovell/sharp/releases/tag/v0.33.2

},
},
```

##### Others

Expand Down