TypeORM, Express - There are no adapters supporting one of the resource you provided

See original GitHub issue

Describe the bug I’m trying to set up adminBro using typeORM and Express, following the instructions from the @adminbro/typeORM page https://www.npmjs.com/package/admin-bro-typeorm

Installed libraries and their versions

    "@admin-bro/express": "^3.1.0",
    "@admin-bro/typeorm": "^1.4.0",
    "@types/faker": "^5.5.3",
    "@types/multer": "^1.4.7",
    "admin-bro": "^4.0.1",
    "express": "^4.18.0",
    "express-formidable": "^1.2.0",
    "express-session": "^1.17.2",
    "express-validator": "^6.10.1",
    "mysql": "^2.18.1",
    "ts-node": "^9.1.1",
    "typeorm": "^0.2.45",
    "typescript": "^4.2.4",

Steps to reproduce the behavior:

  1. Try to run
  2. See error

Expected behavior Run without errors

AdminJSOptions with schema

private initializeAdminBro(): void {
    AdminBro.registerAdapter({ Database, Resource });
    const adminBro = new AdminBro({
      databases: [connection.create()],
      resources: [
        { resource: UsersEntity, options: { parent: { name: 'foobar' } } },
        { resource: PagesEntity, options: { parent: { name: 'foobar' } } },
      ],
      rootPath: '/admin',
    });
    const router = AdminBroExpress.buildRouter(adminBro);
    this.app.use(adminBro.options.rootPath, router);
  }

User Entity and Base Entity

@Entity(TableName.USER)
export default class UsersEntity extends BaseModel {
  @PrimaryGeneratedColumn()
  public id?: number;

  @Column({
    type: 'varchar',
    length: 255,
    nullable: false,
  })
  public email: string;

  @Column({
    type: 'varchar',
    length: 150,
    nullable: false,
  })
  public name: string;

  @Column({
    type: 'timestamp',
    nullable: true,
  })
  public email_verified_at?: Date;

  @Column({
    type: 'varchar',
    length: 255,
    nullable: false,
  })
  public password: string;

  @CreateDateColumn({ type: 'timestamp' })
  public created_at?: Date;

  @UpdateDateColumn({ type: 'timestamp' })
  public updated_at?: Date;

  /**
   * @type {UsersAuthTokensModel[]}
   */
  @OneToMany(() => UsersAuthTokensModel, authTokens => authTokens.user)
  public authTokens: UsersAuthTokensModel[];

  /**
   * @type {UsersTokensModel[]}
   */
  @OneToMany(() => UsersTokensModel, tokens => tokens.user)
  public tokens: UsersTokensModel[];
}`
`import { BaseEntity } from 'typeorm';

export default class BaseModel extends BaseEntity {
  public id?: number;
  public created_at?: Date;
  public updated_at?: Date;
}

Desktop (please complete the following information if relevant):

  • OS: Ubuntu
  • Browser Node
  • Version 14

Additional context If you need any additional information, please let me know.

It is also worth noting that if you create admin bro like this:

const adminBro = new AdminBro({
      databases: [],
      resources: [],
      rootPath: '/admin',
    });

then the application starts, but there is nothing on the route /admin

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dzirafcommented, Apr 28, 2022

Please update to adminjs/@adminjs packages, we no longer support admin-bro/@admin-bro, they’re already old

0reactions
AshotNcommented, Jun 3, 2022

Have you defined the entities in your TypeORM data source?

Read more comments on GitHub >

github_iconTop Results From Across the Web

There are no adapters supporting one of the resource you ...
Describe the bug when I try to set up AdminBro for Nest.js + typeorm I am getting the next error: UnhandledPromiseRejectionWarning: ...
Read more >
How to use @admin-bro/nestjs with @admin-bro/typeorm and ...
... There are no adapters supporting one of the resource you provided when I tried to integrate AdminBro with NestJS/Express/TypeORM (though ...
Read more >
NoResourceAdapterError: There are no adapters supporting ...
Describe the bug when I try to set up AdminBro for Nest.js + typeorm I am getting the next error:
Read more >
[Solved]-How to use @admin-bro/nestjs with ... - appsloveworld
... NoResourceAdapterError: There are no adapters supporting one of the resource you provided when I tried to integrate AdminBro with NestJS/Express/TypeORM ...
Read more >
Create an Admin Panel With Node.js and AdminBro
Installing the Database Adapter and Adding Resources. AdminBro can be connected to many different types of resources. Right now, they support the following ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found