ngx-mqtt: Problem with using ngx-mqtt 6.11.0 angular 8

https://github.com/mteodor/mqtt-ng

  • [x ] I have searched for similar issues in this repository, but couldn’t find one.
  • [ x] I have read the README and have a basic understanding how angular works.

I’m submitting a…

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report  
  • Feature request
  • Support question

Current behavior

AppComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'ngInjectableDef' of undefined
    at getInjectableDef (core.js:319)
    at resolveNgModuleDep (core.js:26375)
    at NgModuleRef_.get (core.js:27479)
    at injectInjectorOnly (core.js:657)
    at ɵɵinject (core.js:667)
    at injectArgs (core.js:757)
    at core.js:1409
    at _callFactory (core.js:26484)
    at _createProviderInstance (core.js:26427)
    at resolveNgModuleDep (core.js:26386)

if I add MqttService to providers I get

compiler.js:2175 Uncaught Error: Can't resolve all parameters for MqttService: (?, ?).
    at syntaxError (compiler.js:2175)
    at CompileMetadataResolver._getDependenciesMetadata (compiler.js:20166)
    at CompileMetadataResolver._getTypeMetadata (compiler.js:20061)
    at CompileMetadataResolver._getInjectableTypeMetadata (compiler.js:20279)
    at CompileMetadataResolver.getProviderMetadata (compiler.js:20288)
    at compiler.js:20226

Expected behavior

Minimal reproduction of the problem with instructions

https://github.com/mteodor/mqtt-ng

What is the motivation / use case for changing the behavior?

Environment

➜  mqtt-ng git:(master) ✗ npm version                                                                                                                                                                                               
{                                                                                                                                                                                                                                   
  'mqtt-ng': '0.0.0',                                                                                                                                                                                                               
  npm: '6.10.0',                                                                                                                                                                                                                    
  ares: '1.15.0',                                                                                                                                                                                                                   
  brotli: '1.0.7',                                                                                                                                                                                                                  
  cldr: '35.1',                                                                                                                                                                                                                     
  http_parser: '2.8.0',                                                                                                                                                                                                             
  icu: '64.2',                                                                                                                                                                                                                      
  llhttp: '1.1.4',                                                                                                                                                                                                                  
  modules: '72',                                                                                                                                                                                                                    
  napi: '4',                                                                                                                                                                                                                        
  nghttp2: '1.38.0',                                                                                                                                                                                                                
  node: '12.6.0',                                                                                                                                                                                                                   
  openssl: '1.1.1c',                                                                                                                                                                                                                
  tz: '2019a',                                                                                                                                                                                                                      
  unicode: '12.1',                                                                                                                                                                                                                  
  uv: '1.30.1',                                                                                                                                                                                                                     
  v8: '7.5.288.22-node.14',                                                                                                                                                                                                         
  zlib: 
}
Angular CLI: 8.1.0
Node: 12.6.0
OS: linux x64
Angular: 8.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-s

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.0
@angular-devkit/build-angular     0.801.0
@angular-devkit/build-optimizer   0.801.0
@angular-devkit/build-webpack     0.801.0
@angular-devkit/core              8.1.0
@angular-devkit/schematics        8.1.0
@ngtools/webpack                  8.1.0
@schematics/angular               8.1.0
@schematics/update                0.801.0
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.35.2


ngx-mqtt version:6.11.0


- Aedes mqtt broker


About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 29 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Small status report: I’m currently working on an “angular 8 only” version. Mabye that solves the issue.

@jlmayoral could you elaborate, why that could be the problem?

@TomasLukac I’m open for pull requests, if you find a solution.

Thank you for answer during your holiday. I hope you can solve it (I’m excited about the solution), but in the meantime enjoy your holiday 😊

Thank you for your well-elaborated issue. I’ll dig into it asap.