What does the following error message mean?
fence has already activated — too late to add writes
Here’s an example of how to get it:
Environment:
- Mac OS X Lion
- Meteor 0.3.8
Project creation:
meteor create test
cd test
meteor add coffeescript http
mv test.js test.coffee
meteor
test.coffee:
Records = new Meteor.Collection("records")
if Meteor.is_client
Meteor.startup ->
Meteor.call "test"
if Meteor.is_server
Meteor.methods
test: ->
Meteor.http.get "http://www.meteor.com", ->
Records.insert some:"data"
Once the method is done executing you can’t add additional writes. To delay completing the methods you can use Futures. Something like this: