Meteor未检测到新文件

时间:2016-11-04 16:41:45

标签: meteor meteor-blaze

每当我在'import / ui /'内创建新目录或文件时未检测到更改。

一旦手动重启服务器,错误就会消失,一切正常。

这种行为是故意的吗?我可以更改它,以便Meteor自动检测新文件吗?

这是我的代码:

//client/main.js
import '../imports/ui/body.js';

_

//imports/ui/body.js
import { Template } from 'meteor/templating';

import './body.html';

Template.body.helpers({
  tasks: [
  { text: 'This is task 1' },
  { text: 'This is task 2' },
  { text: 'This is task 3' },
  ],
});

_

//imports/ui/body.html
<body>
  <div class="container">
    <header>
      <h1>Todo List</h1>
    </header>

    <ul>
      {{#each tasks}}
      {{> task}}
      {{/each}}
    </ul>
  </div>
</body>

<template name="task">
  <li>{{text}}</li>
</template>

这是我在Chrome控制台上遇到的错误:

  

未捕获错误:无法找到模块&#39; ./ template.body.js&#39;       at require(http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:119:19)       at meteorInstall.imports.ui.body.html(http://localhost:3000/app/app.js?hash=daa6958260cc1e0c5e80d55b2d8741e114835c8d:9:18)       在fileEvaluate(http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:191:9)       在Module.require(http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:116:16)       在Module.Mp.import(http://localhost:3000/packages/modules.js?hash=d99e0932efe1a420b80cdbd95cd57dc3604a8456:314:16)       at meteorInstall.imports.ui.body.js(http://localhost:3000/app/app.js?hash=daa6958260cc1e0c5e80d55b2d8741e114835c8d:21:99)       在fileEvaluate(http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:191:9)       在Module.require(http://localhost:3000/packages/modules-runtime.js?hash=ab7e8d32b6c7b5a5fa7ae1b65e8225c4f9e30223:116:16)       在Module.Mp.import(http://localhost:3000/packages/modules.js?hash=d99e0932efe1a420b80cdbd95cd57dc3604a8456:314:16)       在meteorInstall.client.main.js(http://localhost:3000/app/app.js?hash=daa6958260cc1e0c5e80d55b2d8741e114835c8d:38:14

1 个答案:

答案 0 :(得分:0)

将项目的Meteor版本设置为上一个版本:

meteor update --release 1.4.1.3

(感谢diaconutheodor

Source