question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where to put migration startup code in Meteor 1.3+

See original GitHub issue

I’m trying to upgrade my app to 1.3.2.4 and move all my server code into my /imports folder, but I’m running into trouble with this package. When I include Migrations.migrateTo('latest'); inside of /imports/server/startup, I get the error “Cannot call method ‘findOne’ of undefined”.

I’ve tried with and without import { Migrations } from 'meteor/percolate:migrations'; at the top of the file. It doesn’t look like Migrations is an exported variable in the package, so I would assume this would remain available as a global. Perhaps this folder loads before the package Global is available?

Confused 😕

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
npu3pakacommented, May 23, 2016

Thank you. I will check it on few versions and upload fix asap.

0reactions
tmeasdaycommented, Jun 2, 2016

I think you’re right, I’ll fix that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to Meteor 1.3
Remove code related to the Package API from the package.js files and rename them to index.js ,; Move your local packages to the...
Read more >
node.js - Meteor / NodeJS run own code before migration start ...
is there a possibility to execute own code inside a Meteor / Node application before the migrations run? I know about Meteor.startup but...
Read more >
percolatestudio/meteor-migrations - GitHub
As in 'Basics', you can migrate to the latest by running: Meteor. startup(function() { Migrations. migrateTo('latest'); });
Read more >
Migrating to Apollo Server 4 - Apollo GraphQL Docs
Apollo Server 3 is distributed as a fixed set of packages for integrating with ... You can pass your context initialization function directly...
Read more >
Example of Meteor interacting with photon using particle-api-js
Are you using 1.3?, try by creating a new project in 1.3 and put the code in a js file under the server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found