错误:名称为“home”的处理程序已存在

时间:2016-09-02 03:47:54

标签: javascript meteor

我尝试更新铁:中间件堆栈,正如其他人在SO和其他地方所建议的那样,我仍然遇到同样的问题。但是,只有在创建服务器端路由时才会出现问题 - 客户端路由工作正常。

我最终使用meteor add iron:middleware-stack@1.1.0将其添加到.meteor/packages并阻止了一些人提到的版本回滚 - 但这仍然无法解决服务器端路由的问题。

我的服务器端路由的定义类似于:

Router.route('/', {
  name: 'home',
  template: 'home'
}, {
  where: 'server'
});

还有其他我不想要的东西吗?

更新

完整错误:

W20160901-20:41:13.960(-7)? (STDERR) /Users/theitsmith/.meteor/packages/meteor-tool/.1.4.1_1.1h0re2h++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/serve
r-lib/node_modules/fibers/future.js:280
W20160901-20:41:13.961(-7)? (STDERR)                                            throw(ex);
W20160901-20:41:13.961(-7)? (STDERR)                                            ^
W20160901-20:41:13.961(-7)? (STDERR) 
W20160901-20:41:13.962(-7)? (STDERR) Error: Handler with name 'home' already exists.
W20160901-20:41:13.962(-7)? (STDERR)     at [object Object].MiddlewareStack._create (packages/iron_middleware-stack/lib/middleware_stack.js:31:1)
W20160901-20:41:13.962(-7)? (STDERR)     at [object Object].MiddlewareStack.push (packages/iron_middleware-stack/lib/middleware_stack.js:47:1)
W20160901-20:41:13.962(-7)? (STDERR)     at Function.Router.route (packages/iron_router/lib/router.js:131:1)
W20160901-20:41:13.964(-7)? (STDERR)     at meteorInstall.server.routing.js (server/routing.js:10:8)
W20160901-20:41:13.966(-7)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160901-20:41:13.968(-7)? (STDERR)     at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160901-20:41:13.968(-7)? (STDERR)     at /Users/theitsmith/WebstormProjects/tsp-www/.meteor/local/build/programs/server/app/app.js:80:1
W20160901-20:41:13.968(-7)? (STDERR)     at /Users/theitsmith/WebstormProjects/tsp-www/.meteor/local/build/programs/server/boot.js:292:10
W20160901-20:41:13.969(-7)? (STDERR)     at Array.forEach (native)
W20160901-20:41:13.969(-7)? (STDERR)     at Function._.each._.forEach (/Users/theitsmith/.meteor/packages/meteor-tool/.1.4.1_1.1h0re2h++os.osx.x86_64+web.browser+web.cordova
/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

包裹清单(meteor list):

$ meteor list
autopublish            1.0.7  (For prototyping only) Publish the entire database to all clients
blaze-html-templates   1.0.4  Compile HTML templates into reactive UI with Meteor Blaze
ecmascript             0.5.8  Compiler plugin that supports ES2015+ in all .js files
es5-shim               4.6.14  Shims and polyfills to improve ECMAScript 5 support
insecure               1.0.7  (For prototyping only) Allow all database writes from the client
iron:core              1.0.11  Iron namespace and utilities.
iron:middleware-stack  1.1.0  Client and server middleware support inspired by Connect.
iron:router            1.0.13  Routing specifically designed for Meteor
iron:url               1.0.11  Url utilities and support for compiling a url into a regular expression.
jquery                 1.11.9  Manipulate the DOM using CSS selectors
meteor-base            1.0.4  Packages that every Meteor app needs
mobile-experience      1.0.4  Packages for a great mobile user experience
mongo                  1.1.12  Adaptor for using MongoDB and Minimongo over DDP
reactive-var           1.0.10  Reactive variable
shell-server           0.2.1  Server-side component of the `meteor shell` command.
showdown               1.0.8  Moved to the 'markdown' package
standard-minifier-css  1.2.0  Standard css minifier used with Meteor apps by default.
standard-minifier-js   1.2.0  Standard javascript minifiers used with Meteor apps by default.
tracker                1.1.0  Dependency tracker to allow reactive callbacks

包裹清单(cat .meteor/packages):

$ cat .meteor/packages 
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.0.4             # Packages every Meteor app needs to have
mobile-experience@1.0.4       # Packages for a great mobile UX
mongo@1.1.12                   # The database Meteor supports right now
blaze-html-templates@1.0.4    # Compile .html files into Meteor Blaze views
reactive-var@1.0.10            # Reactive variable for tracker
jquery@1.11.9                  # Helpful client-side library
tracker@1.1.0                 # Meteor's client-side reactive programming library

standard-minifier-css@1.2.0   # CSS minifier run for production mode
standard-minifier-js@1.2.0    # JS minifier run for production mode
es5-shim@4.6.14                # ECMAScript 5 compatibility for older browsers.
ecmascript@0.5.8              # Enable ECMAScript2015+ syntax in app code

autopublish@1.0.7             # Publish all data to the clients (for prototyping)
insecure@1.0.7                # Allow all DB writes from clients (for prototyping)
showdown@1.0.8
iron:router
shell-server
iron:middleware-stack@1.1.0
iron:core
iron:url

0 个答案:

没有答案