【问题标题】:Meteor iron-router splash screen error on deploy only仅部署时流星铁路由器闪屏错误
【发布时间】:2015-03-31 11:17:49
【问题描述】:

我在我的本地机器上使用 Meteor 1.0.3.1,并且我正在使用节点 v0.10.36 进行部署。但是,部署机器只显示 Iron-router 初始屏幕...“iron:router”“组织您的 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铁路由器?我太爱你了,你就这样对我!

【问题讨论】:

  • 我团队中的某个人在一个自我部署(mup-deployed)的应用程序中看到了这一点。只有一个使用同一个应用程序的人中的一个看到了它,并且只有使用 Google chrome 浏览器。重启后就消失了。 :(
  • 遗憾的是,这在这里不起作用:(

标签: javascript meteor iron-router


【解决方案1】:

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

<template name="sampleList">

没有真正指出问题出在哪里。

【讨论】:

    【解决方案2】:

    也许它与您的路由文件 (project.js) 的文件位置有关。将它移至/lib 为我解决了这个问题。

    【讨论】:

      【解决方案3】:

      我在 x.meteor.com 和 --production 仿真上获得了相同的初始屏幕,直到我确定每个

      Meteor.publish({});
      

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

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

      这解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-09-03
        • 1970-01-01
        • 1970-01-01
        • 2014-10-30
        • 1970-01-01
        • 2015-08-11
        • 1970-01-01
        • 2016-01-22
        相关资源
        最近更新 更多