Document.js:54 Uncaught TypeError:无法读取未定义的属性(读取“遍历”)Autodesk Viewer + React

问题描述 投票:0回答:2

从2月18日星期日开始,我正在这个项目中进行实验(react + Autodesk Viewer): 项目:https://github.com/autodesk-platform-services/viewer-react-sample 出现以下错误:

Document.js:54未捕获的类型错误:无法读取未定义的属性 (读“穿越”) 在新文档 (Document.js:54:18) 在 Function.onSuccess (Document.js:172:29) 在 onSuccessWrapped (Xhr.js:609:40) 在 XMLHttpRequest.onLoad (Xhr.js:851:34)

Error Image

enter image description here

在那之前,我没有这个问题,问题不存在。我检查了更新,2 月 14 日有一个更新,但我认为与该错误没有任何关系。我尝试了不同的环境、浏览器、计算机等。有人有什么想法吗? 更新: https://aps.autodesk.com/en/docs/viewer/v7/change_history/changelog_v7/

安装带有依赖项的项目,但不运行模型。

reactjs autodesk-forge autodesk-viewer autodesk autodesk-model-derivative
2个回答
1
投票

这可能与 Viewer SDK 最近的更改有关。在此更改之前,可以在不指定

Autodesk.Viewing.Initializer
选项的情况下调用
env
,并且查看器将尝试根据托管它的网站的 URL 自动检测正确的设置。更改后,自动检测的设置可能会有所不同,因此我建议对
env
属性进行硬编码以确保安全。请参阅此博客文章了解更多详细信息:https://aps.autodesk.com/blog/getting-404-resource-not-found-error-viewer


0
投票

loadModel
函数进行一些测试我也遇到了这个错误,我的解决方案是添加
"urn:"
:

Autodesk.Viewing.Document.load(
   "urn:" + urn,
   onDocumentLoadSuccess,
   onDocumentLoadFailure
);
© www.soinside.com 2019 - 2024. All rights reserved.