仅在部署时出现流星铁路由器闪屏错误

时间:2015-02-01 11:08:14

标签: javascript meteor iron-router

我在本地计算机上使用Meteor 1.0.3.1,并且我使用节点v0.10.36进行部署。但是,部署机器只显示铁路由器闪屏......"铁:路由器" "组织你的Meteor应用程序" ...

还有其他几个关于修复这个确切问题的堆栈,包括删除标记和删除项目npm.js文件(从引导程序遗留下来)。这些都不起作用。

project.js文件如下:

Router.route('/', function () {
  this.render('home');
});

Router.route('/about', function () {
  this.render('about');
});

Router.route('/contact', function () {
  this.render('contact');
});

Router.route('/legal', function () {
  this.render('legal');
});

Router.route('imitationgamereview', function () {
  this.render('imitationgamereview');
});


if (Meteor.isClient) {
}

if (Meteor.isServer) {
  Meteor.startup(function () {
    // code to run on server at startup
  });
}

project.html文件如下:

<head>
    <title>my sample project</title>
    <link rel="shortcut icon" href="/favicon.ico?v=2" />
</head>

<template name="home">
  test
</template>

完全疯狂! WTF铁路由器?我爱上了你,那么你就这样对我这么做了!

3 个答案:

答案 0 :(得分:3)

可能与路由文件的文件位置(project.js)有关。将它移到/lib为我解决了问题。

答案 1 :(得分:1)

我在x.meteor.com和--production仿真上获得相同的启动画面,直到我确定每一个

Meteor.publish({});

位于if(Meteor.isServer)语句中,例如

if(Meteor.isServer) {
    Meteor.publish('files', function() {
        return Files.find();
    });
}

这解决了我的问题。

答案 2 :(得分:0)

我刚遇到类似的问题,我不知道这是否适用于您,但在我的情况下,我有两个模板(两个HTML文件)具有相同的模板名称。一旦我删除其中一个,所有都恢复正常。 即,我在file1.html和file2.html中都有这一行:

<template name="sampleList">

没有任何真正表明问题在哪里撒谎。

相关问题