Skip to content
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

Uncaught TypeError: Cannot read property 'user1' of undefined #35

Open
Clan-Utility opened this issue Oct 30, 2016 · 3 comments
Open

Uncaught TypeError: Cannot read property 'user1' of undefined #35

Clan-Utility opened this issue Oct 30, 2016 · 3 comments

Comments

@Clan-Utility
Copy link

For the example

var users = exports.users = {
    user1: {
        _id: id(),
        name: 'Michael'
    },
    user2: {
        _id: id(),
        name: 'George Michael',
        father: users.user1._id
    },
    user3: {
        _id: id('4ed2b809d7446b9a0e000014'),
        name: 'Tobias'
    }
}

Uncaught TypeError: Cannot read property 'user1' of undefined
at Object. (test/fixtures/powMongo/fixtures.js:23:22)
at _fileToObject (node_modules/pow-mongodb-fixtures/src/index.js:419:14)
at node_modules/pow-mongodb-fixtures/src/index.js:400:7

Node v4.2.4

@thmsgbrt
Copy link

Same issue here, did you manage to find a solution ? @Clan-Utility

@Clan-Utility
Copy link
Author

I did something like this:

var users = exports.users = {
    user1: {
        _id: id(),
        name: 'Michael'
    },
    user2: {
        _id: id(),
        name: 'George Michael'
    },
    user3: {
        _id: id('4ed2b809d7446b9a0e000014'),
        name: 'Tobias'
    }
}

users.user2.father = users.user1._id;

Not elegant at all ...

@thmsgbrt
Copy link

thmsgbrt commented Nov 8, 2018

Thanks for your feedback ;)
At the end, I did it manually, without packages and it worked as I need to...
(small fixtures so that's ok)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants