Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

317
Vistas
Mikro-orm: Only abstract entities were discovered

I'm working in a node.js (+Express) backend and I'm trying to use Mikro-orm without using Typescript.

I followed this project as reference + Mikro-orm documentation but I keep getting this error:

MetadataError: Only abstract entities were discovered, maybe you forgot to use @Entity() decorator?

Is there a way to avoid using Typescript's decorators? Or maybe a better question would be is it possible to use Mikro-orm in a pure JS project?

The configuration file mikro-orm.config.js looks like:

module.exports = {
  entities: [EntityX, EntitiyZ],
  type: 'mysql',
  dbName: 'example',
  highlighter: new SqlHighlighter(),
  debug: true
};

The versions I have installed are:

"@mikro-orm/core": "^4.5.10",
"@mikro-orm/mysql": "^4.5.10"

Any help will be much appreciated, thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I was running into this exact problem when I discovered this question (thanks for posting).

I was able to resolve the issue by ensuring the default export from each of my entity files has the shape that Mikro-ORM seems to be expecting, which in your case would look something like:

export default {
    EntityX,
    schema,
    entity: EntityX
}

**EDIT

On second look I realize that you're using CommonJS syntax, so without seeing your entity files I'd assume you could be missing something like:

module.exports.EntityX = EntityX;
module.exports.entity = EntityX;
module.exports.schema = schema;

in your entity file, or you forgot to wire up the entities/index.js as shown in the example you linked.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda