流星帐户:调用 storedLoginToken() "undefined is not a function" 时出错



我将Meteor CollectionFS库添加到我的Meteor项目中,并注意到由于错误Exception in delivering result of invoking '/cfs.images.filerecord/insert': TypeError: undefined is not a function,文件上传无法工作。

在挖掘时,我可以看到undefined is not a function是通过调用Accounts._storedLoginToken()cfs_upload-http.js中抛出的

我不认为CollectionFS是问题的原因,因为我创建了一个与我的项目具有相同依赖关系的伪项目-当我在伪项目中从控制台调用Accounts._storedLoginToken()时,会返回登录令牌,但是,当我从自己的项目从控制台进行相同调用时,我会得到错误TypeError: undefined is not a function

关于是什么原因导致了这种情况,有什么想法吗?

提前感谢

尼尔。

PS值得指出的是,1)在伪项目和原始项目中,我是在调用storedLoginToken时登录的2)在伪和其他项目中,帐户包和cfs集合包都是相同的版本。


更新:

根据要求,以下是虚拟项目(有效)和真实项目(无效)的依赖项。请注意,我实际上并不是在虚拟项目中调用cfs的东西,因为我更关注storedLoginText()问题(cfs问题看起来是这方面的症状,而不是原因)。

伪项目

流星平台米佐:bootstrap-3强调ian:accounts-ui-botstrap-3帐户密码Alded:自动成型阿尔德:收藏2cfs:标准包cfs:uicfs:文件系统熨斗:路由器zimme:铁路由器主动

伪项目版本

accounts-base@1.1.3accounts-password@1.0.6阿尔德:autoform@4.2.2阿尔德:collection2@2.3.1阿尔德:simple-schema@1.1.0反:i18n@0.4.3application-configuration@1.0.4autoupdate@1.1.5base64@1.0.2binary-heap@1.0.2blaze@2.0.4blaze-tools@1.0.2boilerplate-generator@1.0.2callback-hook@1.0.2cfs:access-point@0.1.43cfs:base-package@0.0.27cfs:collection@0.5.3cfs:collection-filters@0.2.3cfs:data-man@0.0.4cfs:file@0.1.15cfs:filesystem@0.1.1cfs:http-methods@0.0.27cfs:http-publish@0.0.13cfs:power-queue@0.9.11cfs:reactive-list@0.0.9cfs:reactive-property@0.0.4cfs:standard-packages@0.5.3cfs:storage-adapter@0.1.1cfs:tempstore@0.1.3cfs:ui@0.1.3cfs:upload-http@0.0.19cfs:worker@0.1.3check@1.0.4coffeescript@1.0.5ddp@1.0.14deps@1.0.6ejson@1.0.5email@1.0.5fastclick@1.0.2follower-livedata@1.0.3geojson-utils@1.0.2handlebars@1.0.2html-tools@1.0.3htmljs@1.0.3http@1.0.10ian:accounts-ui-bootstrap-3@1.2.31id-map@1.0.2铁:controller@1.0.7铁:core@1.0.7铁:dynamic-template@1.0.7铁:layout@1.0.7铁:location@1.0.7铁:middleware-stack@1.0.7铁:router@1.0.7铁:url@1.0.7jquery@1.11.3json@1.0.2launch-screen@1.0.1livedata@1.0.12localstorage@1.0.2logging@1.0.6meteor@1.1.4meteor-platform@1.2.1minifiers@1.1.3minimongo@1.0.6米造:bootstrap-3@3.3.1_1mobile-status-bar@1.0.2momentjs:moment@2.8.4mongo@1.0.11mongo-livedata@1.0.7npm-bcrypt@0.7.7observe-sequence@1.0.4ordered-dict@1.0.2raix:eventemitter@0.1.1random@1.0.2reactive-dict@1.0.5reactive-var@1.0.4reload@1.1.2retry@1.0.2routepolicy@1.0.4service-configuration@1.0.3session@1.0.5sha@1.0.2spacebars@1.0.5spacebars-compiler@1.0.4srp@1.0.2stylus@1.0.6templating@1.0.11tracker@1.0.5ui@1.0.5underscore@1.0.2url@1.0.3webapp@1.1.6webapp-hashing@1.0.2魔法解决方案:underscore-string@1.0.0zimme:iron-router-active@1.0.1

真实项目

流星平台米佐:bootstrap-3强调熨斗:路由器sacha:旋转ian:accounts-ui-botstrap-3帐户密码Alded:自动成型阿尔德:收藏2zimme:铁路由器活动cfs:标准包cfs:文件系统cfs:ui

真实项目版本

accounts-base@1.1.3accounts-password@1.0.5阿尔德:autoform@4.2.2阿尔德:collection2@2.3.1阿尔德:simple-schema@1.1.0反:i18n@0.4.3application-configuration@1.0.4autoupdate@1.1.4base64@1.0.2binary-heap@1.0.2blaze@2.0.4blaze-tools@1.0.2boilerplate-generator@1.0.2callback-hook@1.0.2cfs:access-point@0.1.43cfs:base-package@0.0.27cfs:collection@0.5.3cfs:collection-filters@0.2.3cfs:data-man@0.0.4cfs:file@0.1.15cfs:filesystem@0.1.1cfs:http-methods@0.0.27cfs:http-publish@0.0.13cfs:power-queue@0.9.11cfs:reactive-list@0.0.9cfs:reactive-property@0.0.4cfs:standard-packages@0.5.3cfs:storage-adapter@0.1.1cfs:tempstore@0.1.3cfs:ui@0.1.3cfs:upload-http@0.0.19cfs:worker@0.1.3check@1.0.3coffeescript@1.0.5ddp@1.0.13deps@1.0.6ejson@1.0.5email@1.0.5fastclick@1.0.2follower-livedata@1.0.3geojson-utils@1.0.2handlebars@1.0.2html-tools@1.0.3htmljs@1.0.3http@1.0.9ian:accounts-ui-bootstrap-3@1.2.21id-map@1.0.2铁:controller@1.0.7铁:core@1.0.7铁:dynamic-template@1.0.7铁:layout@1.0.7铁:location@1.0.7铁:middleware-stack@1.0.7铁:router@1.0.7铁:url@1.0.7jquery@1.0.2json@1.0.2launch-screen@1.0.1livedata@1.0.12localstorage@1.0.2logging@1.0.6meteor@1.1.4meteor-platform@1.2.1minifiers@1.1.3minimongo@1.0.6米造:bootstrap-3@3.3.1_1mobile-status-bar@1.0.2momentjs:moment@2.8.4mongo@1.0.11mongo-livedata@1.0.7npm-bcrypt@0.7.7observe-sequence@1.0.4ordered-dict@1.0.2raix:eventemitter@0.1.1random@1.0.2reactive-dict@1.0.5reactive-var@1.0.4reload@1.1.2retry@1.0.2routepolicy@1.0.3萨查:spin@2.0.4service-configuration@1.0.3session@1.0.5sha@1.0.2spacebars@1.0.4spacebars-compiler@1.0.4srp@1.0.2stylus@1.0.6templating@1.0.10tracker@1.0.4ui@1.0.5underscore@1.0.2url@1.0.3webapp@1.1.5webapp-hashing@1.0.2魔法解决方案:underscore-string@1.0.0zimme:iron-router-active@1.0.1

好吧,我解决了这个问题,解决方案很简单,也很尴尬:)

给。。。。。不要将自己的收藏称为"账户"。

是的,Accounts._storedLoginToken()出错的原因是它调用了我的集合上的方法,而不是accounts包中声明的方法。

如果有人重复我的错误,我会把这个答案留在这里(因为这是我应得的:)

最新更新