Closed TylerL-uxai closed 4 years ago
Seeding movies is called before the dummy users are created (async type error)
const createDummyUsers = function () {
console.log('// seeding users…');
createUser('Bruce', 'dummyuser1@telescopeapp.org');
createUser('Arnold', 'dummyuser2@telescopeapp.org');
createUser('Julia', 'dummyuser3@telescopeapp.org');
};
export const seedMovies = () => {
const allUsers = Users.find().fetch();
if (allUsers.length === 0) {
createDummyUsers();
}
if (Movies.find().fetch().length === 0) {
console.log('// seeding movies…');
Oh right, see also https://github.com/VulcanJS/Vulcan/pull/1849
Let me know if it's fixed now.
Trying to merge, but it's in a different repo (VulcanJs instead of Vulcan-Starter)
Oh sorry, I meant I fixed it here: https://github.com/VulcanJS/Vulcan-Starter/commit/c0166f9fb29acefb293c9e2bada95d358b815885
Check out step 12 with the dummy data. userId still isn't being added, but you did fix the async.
return await context.Users.loader.load(movie.userId); //movie.userId === undefined
OK, got it. I was missing a return
statement! Should work now :)
I googled around and found this because I was getting the same error...
Already tried replacing the /getting-started/lib/server/seed.js file with the one at c0166f9
Then I went to the meteor shell to call seedMovies(), but I'm still getting the error..
How would I fix this (without reinstalling the whole thing). Any suggestions? Thanks
@efficienthacks you would also need to add the code from here: https://github.com/VulcanJS/Vulcan-Starter/commit/8f944b33fbc437c807682d3bf587fc25b6d6df97
Or you could git pull
the repo to get the latest version.
Closed as resolved
Following along with the tutorial and got this error on Resolvers
Modified (uncommented) code
Here's the query from meteor mongo:
Update:
After debugging, I found the line that's causing the program to crash
return await context.Users.loader.load(movie.userId);