kolkov / ngx-dadata

Angular 6+ and 13+ DaData suggestion (подсказки) service implementation
MIT License
12 stars 14 forks source link

ngx-dadata is not work with angular core < 8 #4

Open nmorozov opened 4 years ago

nmorozov commented 4 years ago
WARNING in ./node_modules/@kolkov/ngx-dadata/fesm5/kolkov-ngx-dadata.js 72:58-76
"export 'ɵɵdefineInjectable' was not found in '@angular/core'

WARNING in ./node_modules/@kolkov/ngx-dadata/fesm5/kolkov-ngx-dadata.js 72:154-162
"export 'ɵɵinject' was not found in '@angular/core'
kolkov-ngx-dadata.js:72 Uncaught TypeError: Object(...) is not a function
    at kolkov-ngx-dadata.js:72
    at Module../node_modules/@kolkov/ngx-dadata/fesm5/kolkov-ngx-dadata.js (kolkov-ngx-dadata.js:74)
    at __webpack_require__ (bootstrap:83)
    at Module../node_modules/@kolkov/ngx-dadata/kolkov-ngx-dadata.ngfactory.js (kolkov-ngx-dadata.js:468)
    at __webpack_require__ (bootstrap:83)
    at Module../src/app/@ui/components/generic/formly/address-autocomplete-type/address-autocomplete-type.component.ngfactory.js (filter.component.ts:41)
    at __webpack_require__ (bootstrap:83)
    at Module../src/app/app.module.ngfactory.js (app.component.ts:165)
    at __webpack_require__ (bootstrap:83)
    at Module../src/main.ts (main.ts:1)
kolkov commented 4 years ago

Thanks! Provide your packages versions please.

nmorozov commented 4 years ago

Thanks! Provide your packages versions please.

You can reproduce this bug by change "@angular/core" to "7.2.14" version at https://stackblitz.com/edit/ngx-dadata?file=package.json

My packages:

    "@angular/animations": "^7.0.3",
    "@angular/cdk": "^7.0.4",
    "@angular/common": "7.0.3",
    "@angular/compiler": "7.0.3",
    "@angular/core": "^7.2.14",
    "@angular/forms": "7.0.3",
    "@angular/http": "7.0.3",
    "@angular/material": "^7.0.4",
    "@angular/material-moment-adapter": "7.0.4",
    "@angular/platform-browser": "7.0.3",
    "@angular/platform-browser-dynamic": "7.0.3",
    "@angular/router": "7.0.3",
    "@kolkov/ngx-dadata": "^0.4.0",
    "@material/layout-grid": "0.41.0",
    "@ngx-formly/core": "4.8.0",
    "@ngx-formly/material": "4.8.0",
andreysolovyov commented 4 years ago

Any updates about this issue?

kozhevnikovEvgenii commented 4 years ago

I had problem with

"ERROR in node_modules/@kolkov/ngx-dadata/lib/ngx-dadata.component.d.ts(37,9): error TS1086: An accessor cannot be declared in an ambient context. node_modules/@kolkov/ngx-dadata/lib/ngx-dadata.component.d.ts(38,9): error TS1086: An accessor cannot be declared in an ambient context.",

It's problem with typescript version less than 3.6. For solve this i reduced version of this package: npm install @kolkov/ngx-dadata@"<0.7"