meteorite

'Meteor code must always run within a Fiber' error when using NPM package

≡放荡痞女 提交于 2019-12-22 10:15:41
问题 I'm using Meteor.require('npmPackage') to use a NPM package. However I seem to be getting an error when writing to mongo in npm package's callback function. Error: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment. Code npmPackage.getInfo(function(err, data) { UserSession.insert({ key: 'info', value: data }); console.log(data); }); I tried wrapping the code within Fiber but the same error message is

Error: Cannot find module 'underscore' thrown in console for all Meteor commands

故事扮演 提交于 2019-12-22 09:16:05
问题 Error: Cannot find module 'underscore' thrown in console for all Meteor commands After every meteor or meteorite command such as meteor or mrt create myapp the following error is thrown. This error seemed to appear suddenly, as meteor was functional the night before and no changes have been made since. Austins-MacBook-Pro:Projects austinrivas$ mrt create test-app /Users/austinrivas/.meteor/tools/3cba50c44a/tools/meteor.js:1480 }).run(); ^ Error: Cannot find module 'underscore' at Function

How to design a meteor smart package to transparently separate an app into different instances?

泄露秘密 提交于 2019-12-21 12:33:21
问题 This is a question for those who are very familiar with Meteor's architecture. I am trying to design a smart package that can transparently run several "copies" of a Meteor app. That is, given an existing Meteor app, and several predefined groups of users, the package can semi-automagically "segregate" the app - run it in a way that for each group of users, it appears that only those users are using the app . I understand that this functionality could be custom designed for any application.

Where to put a separate admin interface for a Meteor app?

我只是一个虾纸丫 提交于 2019-12-21 03:57:15
问题 I'm trying to build a smart package for Meteor app that provides some monitoring capabilities and other tools based on the features of the smart package. For more details read this question. In any case, I'm trying to figure out the best way to create an admin interface for this package, which will of course be itself running in Meteor. Ideally, I'd like something similar to observatory, except on a separate part of the site that the package can control (or even on a different port.) The way

Speed up Auto-reload in Meteor.js

核能气质少年 提交于 2019-12-21 03:36:18
问题 After saving a file with new changes in Meteor.js, the server will restart and the browser will window reload. Question: Sometimes it takes longer than usual to reload after saving the file, and this appears to be random. Is there a way to trigger the auto-reload more quickly? It appears that the server restart quickly, but the browser reload much more slowely. After the Meteor server have restarted, the webpage becomes unresponsive for 30 sec and the Network tab shows websocket pending... I

When update nested collection in meteor, how to pass variable for the update path

China☆狼群 提交于 2019-12-18 17:24:09
问题 Update a nested collection in meteor is not a problem (and it is described here : Updating a nested property on a collection object with $set) Basic way to do it : Collection.update({sel}, {"$set" : {"address.city": "new address"}}); But what if I want to describe my path with variables ? This one obviously does not work : var cityName = "NYC"; Collection.update({sel}, {"$set" : {"address." + cityName: "new address"}}); Sadly this one does not work either: var path = "address.NYC"; Collection

How to pass a parameter to pathFor in Handlebars for Iron-Router with Meteorite?

守給你的承諾、 提交于 2019-12-18 10:09:17
问题 I have a simple route with a parameter: this.route('article', { path: '/article/:_id', data: function() { return Articles.findOne(this.params._id); } }); I would like to have use the pathFor handlebars helper here with the _id: {{#each articles}} <li><a href="{{pathFor 'article' _id}}">{{title}}</a></li> {{/each}} This doesnt work for passing the _id tag into the url though... 回答1: <li><a href="{{pathFor 'article' _id=this._id }}">{{title}}</a></li> Thats how you pass a parameter 回答2: In your

How do I add console.log() JavaScript logic inside of a Handlebars template?

怎甘沉沦 提交于 2019-12-17 17:54:40
问题 I'm in the process of building a new Meteor app and I can't figure out how to add JavaScript logic with Handlebars to run a console.log() before my each loop. In backbone I would just do, <% console.log(data); %> to test that the data was being passed in. I'm not sure how to do this with Meteor and Handlebars and I couldn't find the solution on their site. 回答1: Create a Handlebars helper in one of the client-loaded JavaScript files in your project: Template.registerHelper("log", function

Meteor.js and Google Maps

孤者浪人 提交于 2019-12-17 15:42:43
问题 i already included maps api into my project. Now i want to show some markers on my map. I initialse my map in a startup function: Meteor.startup(function() { ... var mapOptions = { zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; Map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); Than i set the center of the map on rendering Template.mapPostsList.rendered = function() { var p2 = Session.get('location'); Map.setCenter(new google.maps.LatLng(p2.lat, p2.lng)); var

How to serve static content (images, fonts etc.) using iron router

半世苍凉 提交于 2019-12-17 15:38:48
问题 I just started working with iron router on meteor. I need to show an image on homepage. I was able to configure route for 'home' using the client side routing. For static files I tried to google and found that adding a server side route might help. So, I added the following code on server's router.js. Router.map(function() { this.route('files', { path: '/files/:path(*)', action: function() { var path = this.params.path; console.log('will serve static content @ '+path); this.response.sendfile