-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition of Object field & dot notation #676
Comments
Hi. It's hard to tell what the problem is without reproduction repository.
Please, create one that only tries replicate given problem.
…On Fri, Jul 6, 2018, 10:36 AM Alex Rubner ***@***.***> wrote:
Hi, I've just started playing around with this (awesome!) package and I've
hit an immediate problem
I have a simple Astronomy class which I'm trying to test with the
standard meteor Mocha/Chai, but I get a TypeError just when trying to
save a basic document:
const gw = new Gameweek();
gw.save();
The error is: TypeError: Class.getFields is not a function
From this line:
https://github.com/jagi/meteor-astronomy/blob/v2/lib/modules/fields/utils/castNested.js#L12
I'm really stuck and can't figure out what the issue is: any ideas?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#676>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAKXW1B1WETcggLOJJOiJvRqZ61FPIkks5uDyF2gaJpZM4VFFlg>
.
|
Apologies, of course, I'll provide a minimal reproduction and post it asap |
I figured out the issue while reproducing it, but here it is in case it helps anyone with the same problem: https://github.com/rub1e/astro-reprod See the README, but the issue was that I had an object field that I defined like this:
This caused an error when I tried to save the document because it seems that you shouldn't define Object fields like this The error disappears if you remove either one of those lines. @lukejagodzinski I don't think this is actually a bug, but it might be an idea to mention something about |
Maybe I will consider adding something to the docs but it's quite obvious that you can't add |
I understand, but I promise it wasn't obvious to me! This is how you would do it in https://github.com/aldeed/simple-schema-js#schema-keys I don't know if it needs a dedicated error message, but I think mentioning dot notation in the docs would be useful, because I assume most people who discover Anyway, sorry to waste your time with an obvious error, I'll close this issue if you're happy |
@rub1e yep I know how it's done in And no, people who discover However, I will add some info about field names to the documentation. |
Hi, I've just started playing around with this (awesome!) package and I've hit an immediate problem
I have a simple
Astronomy
class which I'm trying to test with the standard meteor Mocha/Chai, but I get aTypeError
just when trying to save a basic document:The error is:
TypeError: Class.getFields is not a function
From this line: https://github.com/jagi/meteor-astronomy/blob/v2/lib/modules/fields/utils/castNested.js#L12
I'm really stuck and can't figure out what the issue is: any ideas?
The text was updated successfully, but these errors were encountered: