Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
TypeError: bn_js_1.default no es un constructor

Hola a todos, acabo de implementar bn.js en el validador de clase DTO. Y obtuve un error como este:

TypeError: bn_js_1.default no es un constructor en Object.transformFn

¿alguien puede ayudarme? aquí está el DTO:

 import BN from 'bn.js'; import { Transform } from 'class-transformer'; export class IWCreateNftCollectionV1ReqDTO { @Transform(({ value }) => new BN(value.toString())) royalties:BN; }

Y el paquete.json

 "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.2.0" }

Gracias

ACTUALIZAR Resuelto agregando abajo en tsconfig.json

 { "compilerOptions": { ... "esModuleInterop": true, }, }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece que bn.js no usa exportaciones predeterminadas. Puede configurar esModuleInterop: true en su tsconfig , o debería poder import * as BN from 'bn.js'; si no quieres modificar esa configuración

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!