Skip to content

I'm integrating qz tray with my nextJS application but it says some problem any one help me #1377

@CodeArtisanDurjoy

Description

@CodeArtisanDurjoy

This is my Console log

The resource https://cdn.jsdelivr.net/npm/qz-tray@2.1/qz-tray.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.Understand this warning
qzTrayUtils.ts:523 ✅ QZ Tray already connected
allBillForm.tsx:60 search data::  {billYear: 2025, billMonth: 11, yearFromIssueDate: 0, monthFromIssueDate: 0, accZoneId: null, …}
allBillForm.tsx:60 search data::  {billYear: 2025, billMonth: 11, yearFromIssueDate: 0, monthFromIssueDate: 0, accZoneId: null, …}
qzTrayUtils.ts:625 🖨️ Printing to: FrontDesk-BW
qzTrayUtils.ts:626 📥 PDF URL: http://localhost:8080/api/v1/bills/report/invoice?BILL_NO=250801309438
qzTrayUtils.ts:641 📄 PDF size: 48.03 KB
qzTrayUtils.ts:655 📋 Print config: Config {config: {…}, _dirtyOpts: {…}, setPrinter: ƒ, getPrinter: ƒ, reconfigure: ƒ, …}
qzTrayUtils.ts:656 📋 Print data type: pixel
qzTrayUtils.ts:665 ❌ Error printing PDF: TypeError: Cannot read properties of undefined (reading '0')
    at Object.versionCompare (qz-tray.js:768:31)
    at Object.data (qz-tray.js:863:30)
    at Object.print (qz-tray.js:1646:32)
    at printPDF (qzTrayUtils.ts:659:18)
    at async handlePrint (page.tsx:294:7)
push.[project]/node_modules/next/dist/client/app-index.js [app-client] (ecmascript).window.console.error @ app-index.tsx:25
console.error @ hydration-error-info.ts:72
printPDF @ qzTrayUtils.ts:665
await in printPDF
handlePrint @ page.tsx:294
handlePrint @ globalTable.tsx:266
overrideProps.<computed> @ Slot.tsx:108
callCallback @ react-dom.development.js:20565
invokeGuardedCallbackImpl @ react-dom.development.js:20614
invokeGuardedCallback @ react-dom.development.js:20689
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:20703
executeDispatch @ react-dom.development.js:32128
processDispatchQueueItemsInOrder @ react-dom.development.js:32160
processDispatchQueue @ react-dom.development.js:32173
dispatchEventsForPlugins @ react-dom.development.js:32184
(anonymous) @ react-dom.development.js:32374
batchedUpdates$1 @ react-dom.development.js:24953
batchedUpdates @ react-dom.development.js:28844
dispatchEventForPluginEventSystem @ react-dom.development.js:32373
dispatchEvent @ react-dom.development.js:30141
dispatchDiscreteEvent @ react-dom.development.js:30112Understand this error
qzTrayUtils.ts:666 Error details: {message: "Cannot read properties of undefined (reading '0')", stack: 'TypeError: Cannot read properties of undefined (re…st:3000/_next/static/chunks/_9177a6._.js:5229:13)', name: 'TypeError'}
push.[project]/node_modules/next/dist/client/app-index.js [app-client] (ecmascript).window.console.error @ app-index.tsx:25
console.error @ hydration-error-info.ts:72
printPDF @ qzTrayUtils.ts:666
await in printPDF
handlePrint @ page.tsx:294
handlePrint @ globalTable.tsx:266
overrideProps.<computed> @ Slot.tsx:108
callCallback @ react-dom.development.js:20565
invokeGuardedCallbackImpl @ react-dom.development.js:20614
invokeGuardedCallback @ react-dom.development.js:20689
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:20703
executeDispatch @ react-dom.development.js:32128
processDispatchQueueItemsInOrder @ react-dom.development.js:32160
processDispatchQueue @ react-dom.development.js:32173
dispatchEventsForPlugins @ react-dom.development.js:32184
(anonymous) @ react-dom.development.js:32374
batchedUpdates$1 @ react-dom.development.js:24953
batchedUpdates @ react-dom.development.js:28844
dispatchEventForPluginEventSystem @ react-dom.development.js:32373
dispatchEvent @ react-dom.development.js:30141
dispatchDiscreteEvent @ react-dom.development.js:30112Understand this error
page.tsx:305 Print error: TypeError: Cannot read properties of undefined (reading '0')
    at Object.versionCompare (qz-tray.js:768:31)
    at Object.data (qz-tray.js:863:30)
    at Object.print (qz-tray.js:1646:32)
    at printPDF (qzTrayUtils.ts:659:18)
    at async handlePrint (page.tsx:294:7)
push.[project]/node_modules/next/dist/client/app-index.js [app-client] (ecmascript).window.console.error @ app-index.tsx:25
console.error @ hydration-error-info.ts:72
handlePrint @ page.tsx:305
await in handlePrint
handlePrint @ globalTable.tsx:266
overrideProps.<computed> @ Slot.tsx:108
callCallback @ react-dom.development.js:20565
invokeGuardedCallbackImpl @ react-dom.development.js:20614
invokeGuardedCallback @ react-dom.development.js:20689
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:20703
executeDispatch @ react-dom.development.js:32128
processDispatchQueueItemsInOrder @ react-dom.development.js:32160
processDispatchQueue @ react-dom.development.js:32173
dispatchEventsForPlugins @ react-dom.development.js:32184
(anonymous) @ react-dom.development.js:32374
batchedUpdates$1 @ react-dom.development.js:24953
batchedUpdates @ react-dom.development.js:28844
dispatchEventForPluginEventSystem @ react-dom.development.js:32373
dispatchEvent @ react-dom.development.js:30141
dispatchDiscreteEvent @ react-dom.development.js:30112Understand this error
allBillForm.tsx:60 search data::  {billYear: 2025, billMonth: 11, yearFromIssueDate: 0, monthFromIssueDate: 0, accZoneId: null, …}
allBillForm.tsx:60 search data::  {billYear: 2025, billMonth: 11, yearFromIssueDate: 0, monthFromIssueDate: 0, accZoneId: null, …}
all_bills:1 The resource https://cdn.jsdelivr.net/npm/qz-tray@2.1/qz-tray.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.Understand this warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions