You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I started getting these error messages since I integrated RepositoryMixin.
src/application.ts(10,41): error TS4020: 'extends' clause of exported class 'MyApplication' has or is using private name 'Class'.
src/application.ts(10,41): error TS4020: 'extends' clause of exported class 'MyApplication' has or is using private name 'Repository'.
Here is my application.ts code:
import{Application,ApplicationConfig}from'@loopback/core';import{AuthenticationComponent}from'@loopback/authentication';import{RestComponent}from'@loopback/rest';import{DataSourceConstructor,RepositoryMixin}from'@loopback/repository';import{UserController}from"./controllers";import{UserRepository}from'./repositories';import{MySequence}from"./auth-sequence";import{db}from'./datasources/mysql.datasource';exportclassMyApplicationextendsRepositoryMixin(Application){constructor(options?: ApplicationConfig){// Allow options to replace the defined components array, if desired.options=Object.assign({},{components: [AuthenticationComponent,RestComponent],rest: {sequence: MySequence}},options,);super(options);this.setupRepositories();this.setupControllers();}setupRepositories(){constdatasource=this.options&&this.options.datasource ? newDataSourceConstructor(this.options.datasource) : db;this.bind('datasource').to(datasource);this.repository(UserRepository);}setupControllers(){this.controller(UserController);}}
The text was updated successfully, but these errors were encountered:
Regarding the all-too-common "has or is using private name" error, I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I started getting these error messages since I integrated RepositoryMixin.
src/application.ts(10,41): error TS4020: 'extends' clause of exported class 'MyApplication' has or is using private name 'Class'.
src/application.ts(10,41): error TS4020: 'extends' clause of exported class 'MyApplication' has or is using private name 'Repository'.
Here is my application.ts code:
The text was updated successfully, but these errors were encountered: