Having issues with ngx-print or ngx-printer in Angular 10, errors seem to be related to Ivy
package.json
{
"name": "app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ngcc"
},
"private": true,
"dependencies": {
"@angular/animations": "~10.1.2",
"@angular/common": "~10.1.2",
"@angular/compiler": "~10.1.2",
"@angular/core": "~10.1.2",
"@angular/forms": "~10.1.2",
"@angular/platform-browser": "~10.1.2",
"@angular/platform-browser-dynamic": "~10.1.2",
"@angular/router": "~10.1.2",
"ngx-print": "^1.2.0-beta.5",
"ngx-printer": "^0.8.1",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.2",
...
}
}
app.module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxPrinterModule } from 'ngx-printer/lib/ngx-printer.module'; // This line causes an error
import { NgxPrintModule } from 'ngx-print/lib/ngx-print.module'; // This line causes an error
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgxPrinterModule.forRoot({printOpenWindow: true}),
NgxPrintModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
ERROR
ERROR in ./src/app/app.module.ts Module not found: Error: Can't resolve 'ngx-print/lib/ngx-print.module' in 'D:\angular print\app\src\app'
ERROR in ./src/app/app.module.ts Module not found: Error: Can't resolve 'ngx-printer/lib/ngx-printer.module' in 'D:\angular print\app\src\app'