Comments (7)
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.
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.
We cannot remove the import because of https://github.com/szokodiakos/typegoose/blob/master/src/prop.ts#L176
from typegoose.
@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.
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.
@Ben305
reflect-metadata
is a polyfill, typegoose shouldn't import it by itself
from typegoose.
Closing this as it's out of date.
from typegoose.
Related Issues (20)
- Please use the new Repository to open new issues HOT 4
- Pre hook supplied function error HOT 56
- TypeError: Class constructor Typegoose cannot be invoked without 'new' HOT 1
- [Request] Setting Collection Name and other Schema options via annotation and reflections
- [Question] Import ObjectId from Typegoose? HOT 4
- Please archive this repo
- Is there any way to achieve schema inheritance with typegoose? HOT 2
- [Question] Type of User.x property is not a y HOT 1
- Is it possible to use getModelForClass with generics? HOT 1
- [Question] HOT 1
- my populate field cant be queried out HOT 3
- [Question] HOT 1
- [Question] Problems reusing the same schema for both collection and subdocument HOT 1
- [Question] Can we add custom error messages when @prop options fail? HOT 2
- [Question] Are transactions supported for deleteMany? HOT 1
- [Question] Possible to have Query type support? HOT 1
- bi-directional virtuals population issue HOT 1
- Cannot use same model on two connections. HOT 2
- [Question] Is there a `required if` feature on model classes? HOT 2
- Both updatedBy and CreatedBy are getting updated after update operation on model object HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typegoose.