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

Meteor iron-router splash screen error on deploy only

本文关键字:路由器 屏幕 错误 流星 部署      更新时间:2023-09-26

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

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

项目.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
  });
}

项目.html文件如下:

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

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

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

我在 x.meteor.com 和--生产仿真上得到了相同的启动画面,直到我确保每个

Meteor.publish({});

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

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

这为我解决了问题。

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

<template name="sampleList">

没有什么真正表明问题出在哪里。