Can't bind to 'src' since it isn't a known property of 'pdf-viewer'


#1

HI Hello,
I stuck with some problem regarding ng2-pdf-viewer.
Description:

using
Ionic framework 3.9
npm 5.6.0
node 8.9.4
angular 4
getting Can’t bind to ‘src’ since it isn’t a known property of 'pdf-viewer’
for building for android 7.0
i checked with ng2-pdf-viewer@3.8.0 version too
getting error like
’pdf-viewer’ is not a known element: 1. If ‘pdf-viewer’ is an Angular component, then verify that it is part
of this module. 2. If ‘pdf-viewer’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the
@NgModule.schemas’ of this component to suppress this message. (" [ERROR ->]<pdf-viewer
[src]=“pdfSrc” [show-all]=“false” [page]=“page” (after-load-complete)=“afterLoadComplete(”)

this is my app.module.ts

import { BrowserModule } from ‘’;
import { ErrorHandler, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from ‘’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { SplashScreen } from ‘’;
import { StatusBar } from ‘’;
import { PdfViewerModule } from ‘ng2-pdf-viewer’;
import { MyApp } from ‘./app.component’;
import { ZoomAreaModule } from ‘…/pages/zoom/zoom-area.module’;
import { BrowserAnimationsModule } from ‘/animations’;
import { InAppBrowser } from ‘’;
import { FileTransfer } from ‘’;
import { FCM } from ‘’;
import { BackgroundMode } from ‘’;
import { HttpModule } from ‘’;
import { Network } from ‘’;
import { Vibration } from ‘’;
import { Device } from ‘’;
import { DatePicker } from ‘’;
import { FilePath } from ‘’;
import { FileChooser } from ‘’;
import { PdfViewerPageModule } from ‘…/pages/patient-module/pdf-viewer/pdf-viewer.module’;

@NgModule({
declarations: [
MyApp,

],
imports: [
BrowserModule,
PdfViewerModule,
BrowserAnimationsModule,
PdfViewerPageModule,
ZoomAreaModule.forRoot(),
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,

],
providers: [
StatusBar,
SplashScreen,
InAppBrowser,
FileTransfer,
FileChooser,
FilePath,
DatePicker,
Device,
Vibration,
Network,
BackgroundMode,
FCM,
{ provide: ErrorHandler, useClass: IonicErrorHandler }
],
schemas:[CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA]
})
export class AppModule { }

when running with “ionic cordova run android --prod” and “ionic serve”


#2

Hi,

Did you get a fix on your problem ? I have the same issue here …
Thanks for your help !


#3

probably its because of node and npm updates…
Please check with your node and npm