Pre-registration frontend build error

I’m trying to build pre-registration-ui from branch sdec-1.2.0.1. but getting following error.
everything works if I remove pdfjs-dist dependent code parts from source.

I’m using workflow prereg-ui-build-manual.yml

Steps:

  1. Fork GitHub - SLUDI-Pilot/pre-registration-ui to new repo
  2. Run action prereg-ui-build-manual.yml

Result:

2026-01-16T07:28:11.2063026Z > pre-registration@1.1.4 build /home/runner/work/pre-registration-ui-new/pre-registration-ui-new/pre-registration-ui
2026-01-16T07:28:11.2064363Z > ng build "--prod" "--base-href" "." "--output-path=dist"
2026-01-16T07:28:11.2064786Z 
2026-01-16T07:28:18.6654221Z 
2026-01-16T07:28:18.6658846Z Date: 2026-01-16T07:28:18.664Z
2026-01-16T07:28:18.6659985Z 
2026-01-16T07:28:18.6663494Z ERROR in : Unexpected value 'NgxPrintModule in /home/runner/work/pre-registration-ui-new/pre-registration-ui-new/pre-registration-ui/node_modules/ngx-print/lib/ngx-print.module.d.ts' imported by the module 'AppModule in /home/runner/work/pre-registration-ui-new/pre-registration-ui-new/pre-registration-ui/src/app/app.module.ts'. Please add a @NgModule annotation.
2026-01-16T07:28:18.6711742Z ##[error]node_modules/pdfjs-dist/types/src/display/annotation_storage.d.ts(66,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6722269Z ##[error]node_modules/pdfjs-dist/types/src/display/annotation_storage.d.ts(80,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6724543Z ##[error]node_modules/pdfjs-dist/types/src/display/api.d.ts(1410,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6726596Z ##[error]node_modules/pdfjs-dist/types/src/display/api.d.ts(1466,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6728831Z ##[error]node_modules/pdfjs-dist/types/src/display/editor/annotation_editor_layer.d.ts(190,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6731561Z ##[error]node_modules/pdfjs-dist/types/src/display/editor/editor.d.ts(225,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6733711Z ##[error]node_modules/pdfjs-dist/types/src/display/editor/tools.d.ts(173,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6735848Z ##[error]node_modules/pdfjs-dist/types/src/display/editor/tools.d.ts(245,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6738007Z ##[error]node_modules/pdfjs-dist/types/src/display/editor/tools.d.ts(271,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6740366Z ##[error]node_modules/pdfjs-dist/types/src/display/metadata.d.ts(10,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6742674Z ##[error]node_modules/pdfjs-dist/types/src/display/optional_content_config.d.ts(11,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6745049Z ##[error]node_modules/pdfjs-dist/types/web/annotation_editor_layer_builder.d.ts(55,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6747351Z ##[error]node_modules/pdfjs-dist/types/web/pdf_find_controller.d.ts(83,5): error TS1127: Invalid character.
2026-01-16T07:28:18.6749935Z ##[error]node_modules/pdfjs-dist/types/web/text_accessibility.d.ts(41,5): error TS1127: Invalid character.

Hello @dinushkaf

Thank you for reaching out. Please give us some time, and we’ll get back to you with a solution shortly.

Regards

Likhitha

on behalf of MOSIP team

Hi @dinushkaf

Our team is actively working on this issue. In the meantime, I’d like to share our findings along with a few potential remediation steps that you may try from your end.

Root cause:
The application is built on Angular 7, which requires an older version of TypeScript. During dependency installation, npm resolved a newer version of a transitive dependency (pdfjs-dist) used by PDF-related libraries. This version is incompatible with the TypeScript version supported by Angular 7, resulting in TypeScript compilation errors and build failure.

Possible remediation steps:

Step 1: Downgrade ng2-pdf-viewer
Update package.json as below:

"dependencies": {
  "ng2-pdf-viewer": "3.7.2",
  "html2pdf.js": "0.9.1"
}

ng2-pdf-viewer@3.7.2 is compatible with Angular 7 and does not pull an incompatible version of pdfjs-dist.

Step 2: Clean installation

rm -rf node_modules package-lock.json
npm install

Step 3: Verify dependency version

npm ls pdfjs-dist

Expected output:

pdfjs-dist@2.0.x

Step 4: Build and run

ng serve

The application should compile successfully without TypeScript errors.

Our team is validating these fixes internally as well.

Meanwhile, please feel free to try the above steps and let us know if this helps.

Thanks.

Regards,
Varaniya S
Product Owner
Onbehalf of Team MOSIP

Hi Varaniyal,
It seems that version is not available.

node: v14.17.3
npm: 6.14.13

Hi @dinushkaf

Please do the following steps. It will resolve your issue.

Step 1: Downgrade ng2-pdf-viewer
Edit package.json:

"dependencies": {
  "ng2-pdf-viewer": "3.0.8"
}

ng2-pdf-viewer@3.0.8 is compatible with Angular 7 and does pull compatible pdfjs-dist.

Step 2: Clean installation

rm -rf node_modules
npm install

Step 3: Verify dependency version

npm ls pdfjs-dist

Expected output:

pdfjs-dist@1.9.x

Step 4: Build and run

ng serve

The application should compile successfully without TypeScript errors.

Thanks & Regards,
Gokulraj
Team MOSIP.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.