codechavez / angular-inline-editor

angular-inline-editor is a small Angular library that allows the experience to use editable elements (click-to-edit) without the pain and/or hassle.
https://www.npmjs.com/package/angular-inline-editors
MIT License
9 stars 11 forks source link

Support Angular6 - Cannot redeclare block-scoped variable 'ngDevMode' #4

Open ijavid opened 6 years ago

ijavid commented 6 years ago

When using library in a Angular6 project the compilation fails on the following error: ERROR in node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'.

Root cause: The Angular npm packages are read twice.

Please release a new version which supports Angular6

LouisMarzorati commented 5 years ago

Late to the party but I was able to get this to work with Angular7 with one exception. Adding this to your tsconfig.json under compilerOptions will prevent the Angular npm package from being read twice.

"paths": {
      "@angular/*": [
           "../node_modules/@angular/*" 
        ]
    }

The only exception is that it will not work with the AoT enabled, have not dug into the why but disabling AoT / build optimizer under the "build" config in the angular.json file.

 "configurations": {
     "production": {
               ...
              "aot": false,
              "buildOptimizer": false,
               ...
            }
          }
leabdalla commented 5 years ago

Same problem here with angular 7.2.2. Your solution didn't worked.