Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用报错:TypeError: logs.unshift is not a function #2

Closed
Uheinanba opened this issue Oct 15, 2016 · 5 comments
Closed

使用报错:TypeError: logs.unshift is not a function #2

Uheinanba opened this issue Oct 15, 2016 · 5 comments

Comments

@Uheinanba
Copy link

log 存储在localstorage。 在 app.js 中
刷新页面的时候
var logs = wx.getStorageSync('logs') || [];会报错

是不是需要JSON.parse 下呢?

@chemzqm
Copy link
Collaborator

chemzqm commented Oct 15, 2016

@huike1989 确实是个 bug,我正在排查中

@chemzqm
Copy link
Collaborator

chemzqm commented Oct 15, 2016

@huike1989 已修复,需要你手工清除下浏览器 localStorage 缓存确保数据没问题。

@moxiaobei2
Copy link

已经更新了吗?还是报错的?
SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at fs.readFile.e (C:\Users\bb\AppData\Roaming\npm\node_modules\wept\lib\util.js:29:34)
at tryToString (fs.js:455:3)
at FSReqWrap.readFileAfterClose as oncomplete

@chemzqm
Copy link
Collaborator

chemzqm commented Oct 15, 2016

@moxiaobei2 你这个报错应该是你的 json 文件格式错了,导致文件无法解析,我刚才改进了错误提示信息。

@chemzqm
Copy link
Collaborator

chemzqm commented Oct 15, 2016

新版提供了数据缓存清理操作

one

点击右上角 ... 唤出这个菜单,如果数据有问题,可以点击清理数据缓存重置一下

@chemzqm chemzqm closed this as completed Oct 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants