This is a migrated thread and some comments may be shown as answers.

Import PDFExportModule - Unexpected token '<'

3 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 04 Sep 2020, 12:50 AM

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",

 

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 07 Sep 2020, 06:30 AM

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).

0
Sebastian
Top achievements
Rank 1
answered on 08 Sep 2020, 12:08 AM

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!

 

0
T. Tsonev
Telerik team
answered on 08 Sep 2020, 07:23 AM

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).

Tags
General Discussions
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Sebastian
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or