Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

[bug]: Cannot build with strict mode #47

@panudetjt

Description

@panudetjt

Bug Report

It's cannot build with "strict": true in tsconfig.json

Ionic version:

[x] 4.x

Current behavior:

Throw chaos errors

Expected behavior:

Peaceful build pass

Steps to reproduce:

git clone git@github.com:SimonGolms/ngx-ionic-image-viewer.git
cd ngx-ionic-image-viewer/demo
// Edit tsconfig.json below
npm install
npm run build -- --prod

Related code:

// tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "strict": true,   // I'm here 0/
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom"],
    "paths": {
      "@angular/*": ["../node_modules/@angular/*"]
    }
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

Other information:

build log

> ngx-ionic-image-viewer-demo@0.0.2 build /Users/usera/Desktop/projects/ngx-ionic-image-viewer/demo
> ng build "--prod"


ERROR in node_modules/ngx-ionic-image-viewer/ngx-ionic-image-viewer.d.ts.NgxIonicImageViewerComponent.html(5,3): Type 'string | undefined' is not assignable to type 'string'.
  Type 'undefined' is not assignable to type 'string'.
node_modules/ngx-ionic-image-viewer/ngx-ionic-image-viewer.d.ts.ViewerModalComponent.html(1,13): Object is possibly 'undefined'.
node_modules/ngx-ionic-image-viewer/ngx-ionic-image-viewer.d.ts.ViewerModalComponent.html(22,13): Object is possibly 'undefined'.```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions