当我运行我的流星项目时,出现了这个问题:
ReferenceError: Session is not defined
at app/_components/talk/views/friends_list.coffee.js:1:16
at /home/xyz/web/edp/.meteor/local/build/server/server.js:298:12
at Array.forEach (native)
at Function._.each._.forEach (/home/xyz/.meteorite/meteors/meteor/
meteor/9bb2b5447e845c4f483df5e9b42a2c1de5ab909b/
dev_bundle/lib/node_modules/underscore/underscore.js:78:11)
这是我的目录结构(我已经更改了文件的名称):
├── _components
│ ├── project_form
│ │ └── client
│ │ ├── lib
│ │ │ └── ...
│ │ ├── project_info
│ │ │ ├── x1.coffee
│ │ │ ├── x2.html
│ │ │ ├── x3.coffee
│ │ │ └── x4.html
│ │ └── views
│ │ ├── x5.coffee
│ │ └── x6.html
│ ├── README.md
│ └── talk
│ └── client
│ ├── x7.coffee
│ ├── x8.html
│ ├── x9.coffee
│ ├── x10.html
│ ├── x11.coffee
│ ├── x12.html
│ ├── x13.coffee
│ ├── x14.html
│ └── x15.less
如果我把目录结构改成下面这样,meteor就可以正常运行了。真不知道为什么,怎么会这样呢?我认为文件加载顺序可能会有所不同。但我无法弄清楚。
├── _components
│ ├── project_form
│ │ └── client
│ │ ├── lib
│ │ │ └── ...
│ │ ├── project_info
│ │ │ ├── x1.coffee
│ │ │ ├── x2.html
│ │ │ ├── x3.coffee
│ │ │ └── x4.html
│ │ └── views
│ │ ├── x5.coffee
│ │ └── x6.html
│ ├── README.md
│ └── talk
│ └── client
│ └── views
│ ├── x7.coffee
│ ├── x8.html
│ ├── x9.coffee
│ ├── x10.html
│ ├── x11.coffee
│ ├── x12.html
│ ├── x13.coffee
│ ├── x14.html
│ └── x15.less