ngx-ionic-image-viewer icon indicating copy to clipboard operation
ngx-ionic-image-viewer copied to clipboard

[bug]: Cannot build with strict mode

Open panudetjt opened this issue 4 years ago • 0 comments

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 [email protected]: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

> [email protected] 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'.```

panudetjt avatar Sep 28 '20 13:09 panudetjt