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

Uncaught TypeError: Cannot read property 'viewer' of undefined #33

Closed
xin- opened this issue Jul 10, 2018 · 5 comments
Closed

Uncaught TypeError: Cannot read property 'viewer' of undefined #33

xin- opened this issue Jul 10, 2018 · 5 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@xin-
Copy link

xin- commented Jul 10, 2018

引用: <script src="https://bos.nj.bpc.baidu.com/assets/mip/projects/mip.js"></script>
使用: MIP.viewer.open() 进行跳转会报错,但是不影响功能
本页刷新没有报错

@PengXing
Copy link
Contributor

哪里报的错,以及传了什么参数,看错误信息,是指 MIP 使 undefined 吗?这个不太可能啊

先补充一下其他的信息把

@easonyq
Copy link
Contributor

easonyq commented Jul 10, 2018

我们BOS的地址应该是 https://bos.nj.bpc.baidu.com/v1/assets/mip/projects/mip.js
而你引用的是 https://bos.nj.bpc.baidu.com/assets/mip/projects/mip.js (没有v1)
因此是不是引用了不正确版本的 mip.js 导致的?尝试更换一下 JS 地址,并能提供详细的信息的话,就最好了。感谢!

@PengXing PengXing added the invalid This doesn't seem right label Jul 11, 2018
@xin-
Copy link
Author

xin- commented Jul 11, 2018

@PengXing 参数就是一个类似 './mip-login.html' 的字符串,
后来解决了, 原因好像是因为,在跳转过去的页面马上使用了MIP.setData方法,然后报错,换了个地方执行,就没有报错了

@xin-
Copy link
Author

xin- commented Jul 11, 2018

@easonyq 貌似这两地址文件是一样样的

@easonyq
Copy link
Contributor

easonyq commented Jul 11, 2018

恩,刚才辉泉告诉我是同步的。所以地址不是问题。
估计是mip.js还未加载完成就调用了方法,所以undefined吧~
总之解决了就最好了!

@easonyq easonyq closed this as completed Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants