Coder Social home page Coder Social logo

Comments (7)

AmazingTurtle avatar AmazingTurtle commented on June 21, 2024 1

The reflect-metadata one is a bug.
Typegoose imports reflect-metadata. InversifyJS also requires it. So I imported it aswell.
I did not expect typegoose to import it internally aswell!

This caused me cancer and brainfuck.
If you use both InversifyJS and Typegoose, one must remove the own import of reflect-metadata or else it'll lead to weired errors.
Please leave the import of reflect-metadata to the users. Please.

from typegoose.

szokodiakos avatar szokodiakos commented on June 21, 2024

Hello. Sounds good, less dependencies mean less problems. If you have the time a PR of this would be greatly appreciated. If tests pass and the package remains completely usable then it is fine with me.

from typegoose.

Ben305 avatar Ben305 commented on June 21, 2024

We cannot remove the import because of https://github.com/szokodiakos/typegoose/blob/master/src/prop.ts#L176

from typegoose.

AmazingTurtle avatar AmazingTurtle commented on June 21, 2024

@Ben305 I see you're casting to any here. No strict typing. Therefore reflect-metadata is not required for passing a build.
I say: remove the import and leave it to the user, because other packages are importing reflect-metadata aswell - thus causing an error that's not so nice to resolve.

from typegoose.

Ben305 avatar Ben305 commented on June 21, 2024

We cannot remove it, because:

TypeError: Reflect.getMetadata is not a function
    at /Users/Ben305/Projects/typegoose/lib/prop.js:9:7841

Without casting to any, the typescript compiler throws an error.

I'd like to see a PR if you get it working.

from typegoose.

MichalLytek avatar MichalLytek commented on June 21, 2024

@Ben305
reflect-metadata is a polyfill, typegoose shouldn't import it by itself

from typegoose.

MichalLytek avatar MichalLytek commented on June 21, 2024

Closing this as it's out of date.

from typegoose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.