AlloyLever icon indicating copy to clipboard operation
AlloyLever copied to clipboard

Error: Uncaught InvalidStateError

Open niniun1024 opened this issue 9 years ago • 8 comments

使用F5自动刷新工具起本地服务,页面加载的时候就会出现下面的报错,换另外的本地服务,xhr请求的时候会报下面的错,请问是什么原因导致的?

Error: Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable. Script: http://192.168.172.126/alloy_lever.js Line: 2950 Column: 24 StackTrace: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.

niniun1024 avatar May 12 '16 03:05 niniun1024

@jyy12 你说的问题已经修复了。是AlloyLever的问题,在xhr send之前提前去读取xhr的状态会报这个错。你使用最新版的 AlloyLever 就ok了。

dntzhang avatar May 12 '16 06:05 dntzhang

用了最新版的,ajax请求txt或json的时候报类似下面的错误: Error: Uncaught SyntaxError: Unexpected end of input Script: http://192.168.172.126/console.html Line: 0 Column: -1 StackTrace: SyntaxError: Unexpected end of input

Error: Uncaught SyntaxError: Unexpected token a Script: http://192.168.172.126/console.html Line: 1 Column: 0 StackTrace: SyntaxError: Unexpected token a

niniun1024 avatar May 17 '16 02:05 niniun1024

@jyy12 你的json不符合格式。JSON.parse的时候出错了。我把JSON.parse try catch一下吧。

dntzhang avatar May 18 '16 01:05 dntzhang

@jyy12 最新的OK了。可以输出非json和非标准格式的json。 多谢多谢!!

dntzhang avatar May 18 '16 02:05 dntzhang

实现原理应该比较简单,捕获error或try-catch的msg信息和performance timing等数据插到到页面上展示,好早一些php框架debug模式也有实现,比如输出php的log信息~

ouvens avatar Jun 16 '16 05:06 ouvens

本地启动,报了两个错,一个是queryseletAll of null还有就是跨域问题

holidaying avatar Jun 21 '16 06:06 holidaying

@sessionStorage queryseletAll 是怎么报出来的?代码里都没有queryseletAll 啊

dntzhang avatar Jun 21 '16 09:06 dntzhang

在AlloyLever.js里面。

holidaying avatar Jun 26 '16 01:06 holidaying