Streamlit IFC.js Viewer组件加载失败求助
我跟着教程创建Streamlit IFC数据应用,但IFC可视化组件一直加载失败,不管是按步骤手动操作还是直接克隆仓库都不行,换了两台配置类似的Windows 11笔记本、Chrome和Brave浏览器都没解决。
错误信息
Your app is having trouble loading the _🎮_Viewer.ifc_js_viewer component.
(The app is attempting to load the component from ****, and hasn't received its "streamlit" message.)
If this is a development build, have you started the dev server?
If this is a release build, have you compiled the frontend?
For more troubleshooting help, please see the Streamlit Component docs or visit our forums.
环境信息
- Streamlit版本:1.28.2
- Python版本:3.10.13(Anaconda 3)
- ifcopenshell版本:0.7.0.231127
- 系统:Windows 11
排查与解决建议
确保组件前端编译完成
如果是克隆仓库运行,进入组件目录(如Viewer文件夹),执行前端依赖安装与编译:npm install npm run build完成后回到项目根目录重新启动Streamlit应用。
验证组件依赖安装
确认streamlit-ifc-viewer或教程指定的组件包已正确安装,执行:pip install streamlit-ifc-viewer降级Streamlit版本
新版本Streamlit可能与组件存在兼容性问题,尝试降级到1.25.x版本:pip install streamlit==1.25.0重启应用测试。
排查网络与系统限制
暂时关闭Windows防火墙、代理工具,或者将Streamlit加入系统安全白名单,避免前端资源被拦截。创建干净虚拟环境测试
用Anaconda新建独立环境,仅安装必要依赖排除环境干扰:conda create -n ifc-app python=3.10 conda activate ifc-app pip install streamlit ifcopenshell streamlit-ifc-viewer克隆仓库到该环境后运行应用。
内容的提问来源于stack exchange,提问作者Tommer Rissin

