Can't export pdf using Vue 2 (native Grid)

1 Answer 104 Views
Grid
ANTONIO
Top achievements
Rank 1
Iron
Iron
ANTONIO asked on 01 Mar 2023, 05:14 PM

I can't export my grid to Pdf. On console, this error shows up:

TypeError: allVue.extend is not a function
    at KendoDrawingAdapter.convertPageTemplateToHtml (KendoDrawingAdapter.js?cc56:50:1)
    at eval (core.js?4739:362:1)
    at eval (core.js?4739:466:1)
    at Array.forEach (<anonymous>)
    at doPageBreak (core.js?4739:465:1)
    at next (core.js?4739:1168:1)
    at whenImagesAreActuallyLoaded (core.js?4739:1164:1)
    at handlePageBreaks (core.js?4739:450:1)
    at eval (core.js?4739:308:1)
    at next (core.js?4739:1168:1)

Trying to replicate the issue, I forked this working example from kendo website (https://www.telerik.com/kendo-vue-ui/components/grid/pdf/) into StackBlitz and just changed the Vue package version to the latest v2 (https://stackblitz.com/edit/twqkkz?file=src%2Fmain.vue,package.json).

By just doing that the page has broken with the following error:

TypeError: (0 , vue_1.createTextVNode) is not a function
    at templateFn (main.vue:7:60)
    at Object.eval (main.vue:144:1)
    at eval (main.vue:170:4)
    at eval (main.vue:171:3)
    at eval (<anonymous>)
    at Qt (webcontainer.4131d213adf6116ed795350ac232389585e09527.js:15:30145)
    at webcontainer.4131d213adf6116ed795350ac232389585e09527.js:15:38799
    at U (webcontainer.4131d213adf6116ed795350ac232389585e09527.js:15:13565)
    at webcontainer.4131d213adf6116ed795350ac232389585e09527.js:15:13207
    at Object.eval (main.js:7:36)

So I'm not sure about what is happening, but it seems to be an incompatibility issue with Vue 2.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 02 Mar 2023, 06:51 AM

Hi,

I think this is some issue with Stacklitz itself and the way the support Vue examples.  Here is an example in Codesandbox that is working correctly at my side - https://codesandbox.io/s/distracted-chatelet-1t73er

If you have further questions please let me know.

Regards,
Plamen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ANTONIO
Top achievements
Rank 1
Iron
Iron
commented on 02 Mar 2023, 05:14 PM

Thanks for the reply. Ok, so getting back to my original error 

TypeError: allVue.extend is not a function

Debugging the KendoDrawingAdapter.js gave shown me that the extend method is not in the root of the Vue instance, but in it's default property:

It seems to be something related to this discussion: https://stackoverflow.com/questions/53053068/vue-typescript-override-export-default-vue

So I think the KendoDrawingAdapter.js should be looking for the extend method in both Vue and Vue.default, not only in the root of the Vue instance. Hence the error.

Plamen
Telerik team
commented on 03 Mar 2023, 07:13 AM

Thank you for getting back to us.

I have tested again the codesandbox example that I sent you in my previous example but could not observe the error from the screenshot provided.

Would you please elaborate a bit the issue and send us some updates codesandbox or and isolated sample project where we will be able to replicate the issue and be more helpful?

ANTONIO
Top achievements
Rank 1
Iron
Iron
commented on 06 Mar 2023, 05:24 PM

Hi Plamen,

My project uses Nuxt 2.16.2, which uses Vue 2.7.14. I've managed to reproduce the exact same issue in this sandbox: https://codesandbox.io/p/sandbox/beautiful-tristan-5nvvfy

Plamen
Telerik team
commented on 09 Mar 2023, 06:34 AM

Thank you for elaborating the issue - it seems like an issue in Nuxt 2 indeed - I have logged it in our feedback portal here - https://feedback.telerik.com/kendo-vue-ui/1600603-error-when-exporting-to-pdf-in-nuxt-2

We will do our best to fix it as soon as possible.

Thank you for your concern with Kendo UI for Vue. If you observe other issue please don't hesitate to contact us again.

Tags
Grid
Asked by
ANTONIO
Top achievements
Rank 1
Iron
Iron
Answers by
Plamen
Telerik team
Share this question
or