1

我试图找出各种原因,以及这是如何发生的,但我似乎无法弄清楚。我已经在 freenode 上的#meteor 上问过这个问题,但那个频道有点不靠谱。

问题是,当我使用第二个流星应用程序作为 DDP 源时,我的应用程序停止渲染 css 并继续重新加载页面。(DDP_DEFAULT_CONNECTION_URL)。

好吧,它会在一瞬间渲染 css,然后再次重置 css 完全从浏览器/dom 中消失。

我把我的源代码放在github上,无法呈现css的应用程序是:github.com/mdahiemstra/tripster/tree/master/src/app

流星ddp服务器是:github.com/mdahiemstra/tripster/tree/master/src/api

相当标准的流星设置,没什么太花哨的。当我不包含 DDP 连接 URL 时,应用程序运行良好。

我也在网上放了一个演示,看到它在运行中失败了:应用程序:http ://oozio.nl:5000 /(使用流星应用程序“api”的 DDP)

提前感谢您的任何帮助/指点!

--EDIT 在#meteor 上的一位 irc 用户的帮助下,我们现在通过删除自动更新解决了它,但它几乎不是一个修复程序,我认为它是一个核心流星错误。

4

1 回答 1

1

不要使用DDP_DEFAULT_CONNECTION_URL,而是使用DDP.connect()

DDPConnection = (Meteor.isClient) ? DDP.connect('http://myOtherServer.com') : {};

if(Meteor.isClient) {
    // set the new DDP connection to all internal packages, which require one
    Meteor.connection = DDPConnection;
    Accounts.connection = Meteor.connection;
    Meteor.users = new Mongo.Collection('users');
    Meteor.connection.subscribe('users');
}

// When creating a collection use:
posts = new Mongo.Collection("posts", DDPConnection);
// And to subscribe use the DDP connection
DDPConnection.subscribe("mySubscription");
于 2015-04-30T19:09:17.707 回答