File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * @vitest -environment node
3+ */
4+ import { describe , expect , it } from 'vitest'
5+ import nextConfig from '@/next.config'
6+
7+ describe ( 'Next.js server dependency packaging' , ( ) => {
8+ it ( 'keeps pdfjs external to the production server bundle' , ( ) => {
9+ expect ( nextConfig . serverExternalPackages ) . toContain ( 'pdfjs-dist' )
10+ } )
11+ } )
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ const nextConfig: NextConfig = {
9999 '@daytona/sdk' ,
100100 '@earendil-works/pi-ai' ,
101101 '@earendil-works/pi-coding-agent' ,
102+ /**
103+ * PDF.js loads its worker and optional canvas primitives relative to its package at runtime.
104+ * Bundling relocates that code and leaves DOMMatrix unavailable in the standalone image.
105+ */
106+ 'pdfjs-dist' ,
102107 // The collab-doc seed converter lazily `require`s jsdom for a headless TipTap editor. Keep it
103108 // external so webpack doesn't try to bundle jsdom's dynamic internal requires.
104109 'jsdom' ,
You can’t perform that action at this time.
0 commit comments