Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using moleculer-web as mixin creates type error #24

Open
Kombustor opened this issue Feb 23, 2020 · 1 comment
Open

Using moleculer-web as mixin creates type error #24

Kombustor opened this issue Feb 23, 2020 · 1 comment

Comments

@Kombustor
Copy link

Kombustor commented Feb 23, 2020

I followed the exact tutorial in the Moleculer documentation, this is the code:

import moleculer from 'moleculer';
import ApiGateway from 'moleculer-web';
import { Service } from 'moleculer-decorators';


@Service({
    mixins: [ApiGateway]
})
class ApiService extends moleculer.Service {

    settings = {
        port: process.env.PORT || 8080,
    };
}

export = ApiService;

I'm getting the following error at mixins: [ApiGateway]:

Type 'ServiceSchema<ServiceSettingSchema> & { Errors: ApiGatewayErrors; }' is not assignable to type 'ServiceSchema<ServiceSettingSchema>'.
  Types of property 'dependencies' are incompatible.
    Type 'string | GenericObject | string[] | GenericObject[]' is not assignable to type 'string | ServiceDependency | (string | ServiceDependency)[]'.
      Type 'GenericObject' is not assignable to type 'string | ServiceDependency | (string | ServiceDependency)[]'.
        Type 'GenericObject' is not assignable to type 'string'.

Am I doing anything wrong?

@ColonelBundy
Copy link
Owner

I am unable to reproduce your type error, what typescript version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants