Import PDFExportModule - Unexpected token '<'

4 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    6 posts
    Member since:
    Jun 2017

    Posted 03 Sep Link to this post

    Hello everyone, I hope you can help me.

     

    I am trying to create pdf on my page with "Kendo UI for Angular PDF Export": https://www.telerik.com/kendo-angular-ui/components/pdfexport/

     

    when I added the import "PDFExportModule" to my module:

    import { PDFExportModule } from '@progress/kendo-angular-pdf-export';

    NgModule({
      imports: [
        ReactiveFormsModule,
        QuotationRoutingModule,
        InputsModule,
        ButtonsModule,
        DropDownsModule,
        CommonModule,
        TranslateModule.forChild({
          loader: {
            provide: TranslateLoader,
            useFactory: translateLoaderFactory,
            deps: [HttpClient, MODULE_BASE_PATH],
          },
          isolate: true,
        }),
        MomentModule,
        GridModule,
        NotificationModule,
        PDFExportModule,
        TooltipModule,
        NgxsModule.forFeature(),
      ],
      declarations: [QuotationComponent, RequiredValidator],
      exports: [QuotationComponent],
    })

    I get this error on the browser (image):

      ERROR Error: Uncaught (in promise): Error: Unexpected token '<'
      Evaluating http://localhost:4200/@progress/kendo-angular-pdf-export
      Loading http://localhost:4100/quotation/bundles/quotation.umd.js?v=1599175943971

     

    My page was working correctly before to import "PDFExportModule".

     

    I couldn't find a way to fix this, does anyone know what might be going on?

     

    best regards,

     

    Configuration:

     

    AngularCLI: 10.0.4

    Node: 12.16.0

    Angular: 10.0.5

    ----------

    "@angular/common": "^10.0.5",

    "@angular/core": "^10.0.5",

    "@progress/kendo-angular-common": "^1.2.3",

    "@progress/kendo-drawing": "^1.8.1",

    "@progress/kendo-angular-pdf-export": "^2.0.4",

    "rxjs": "~6.6.0",

     

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2310 posts

    Posted 07 Sep Link to this post

    Hello Sebastian,

    Could you double check whether the kendo-angular-pdf-export package is installed in the node modules of the application? It looks like that the package is not served as expected when the app is trying to access it. You could also try deleting the modules and the corresponding lock files and reinstalling them again.

    Regards,
    Dimiter Madjarov
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

  3. Sebastian
    Sebastian avatar
    6 posts
    Member since:
    Jun 2017

    Posted 07 Sep in reply to Dimiter Madjarov Link to this post

    Hi!, thanks for the reply,

    I deleted the "node_modules" folder and reinstalled "npm install", but the problem remains.

    I tried to replicate this in stackblitz. Although it is not the same error, when I import "PDFExportModule" I get an error "Import error, can't find file:
    ./main "

     

    https://stackblitz.com/edit/angular-ivy-1lhxws?file=src%2Fapp%2Fapp.module.ts

     

    regards!

     

  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2833 posts

    Posted 08 Sep Link to this post

    Hi Sebastian,

    I've replied to your support ticket. Let's keep the communication there until we pinpoint the problem. We can then share the solution with the community in this forum thread.

    Best Regards,
    T. Tsonev
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top