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

[desktop-viewer] stuck loading while fetching imodels #336

Closed
edemiaochu opened this issue Nov 6, 2024 · 14 comments
Closed

[desktop-viewer] stuck loading while fetching imodels #336

edemiaochu opened this issue Nov 6, 2024 · 14 comments
Assignees

Comments

@edemiaochu
Copy link

in desktop-viewer-react project, when i use npm start, the imodels page keeps loading. when i use serve -s ./build ,the imodels page can load normally. why?

Image

@edemiaochu
Copy link
Author

sorry ,in desktop-viewer-test project.

@aruniverse
Copy link
Member

Hi! Have you inspected the network tab? Are the requests to api.bentley.com/imodels resolving?

@edemiaochu
Copy link
Author

Hi,And, when i run npm start to start, the file opened is snapshotconnection,can't edit,but,when i use serve -s ./build and npm run electron:debug to start, the opened file is briefcaseconnection, do you konw why?

@edemiaochu
Copy link
Author

Hi! Have you inspected the network tab? Are the requests to api.bentley.com/imodels resolving?

H i,yes ,the status is 200

@MichaelSwigerAtBentley
Copy link
Contributor

Hi, to clarify, does the iModels page keep loading when attempting to access a specific iTwin's iModels via the 'downloads' option?

@edemiaochu
Copy link
Author

Hi, to clarify, does the iModels page keep loading when attempting to access a specific iTwin's iModels via the 'downloads' option?

Hi , no, imodels keep loading. I can't see download option.[when i run 'npm start']

@MichaelSwigerAtBentley
Copy link
Contributor

Hi, I'm having trouble recreating this.

When running npm start from the viewer\packages\apps\desktop-viewer-test App.tsx is called, which should load the Home.tsx file.

Could you post your console out? Its possible something is occurring during App.tsx initialization

@edemiaochu
Copy link
Author

Image
Image

Hi, Do you mean these ? One is backend console out ,the other is frontend console out

@edemiaochu
Copy link
Author

edemiaochu commented Nov 18, 2024 via email

@MichaelSwigerAtBentley
Copy link
Contributor

Yes, those were the consoles I was referring to, thanks

@MichaelSwigerAtBentley
Copy link
Contributor

I believe I have recreated the issue.

A function seems to be aborting the imodels api calls before they can fully resolve.

It seems possible that when you use npm start to start, the app is making a request for an iTwin via an api call and that request is timing out. The preflight handshake might be returning 200, which is what you are seeing, but the actual response never arrives. When you use serve you are loading a local .bim file, which is working as normal, thus the discrepancy.

Could you take a screenshot of your network tab while searching for api.bentley.com/imodels requests?

@MichaelSwigerAtBentley
Copy link
Contributor

A potential solution:

At lines 31 and 33 in \viewer\packages\apps\desktop-viewer-test\src\frontend\index.tsx, there is a React.StrictMode wrapper.

Try removing that wrapper, then rebuild and attempt the api call again.

@edemiaochu
Copy link
Author

edemiaochu commented Nov 19, 2024 via email

@MichaelSwigerAtBentley
Copy link
Contributor

Yes, this will be resolved in the next version. Thanks for reporting the issue!

@aruniverse aruniverse changed the title loading stuck loading while fetching imodels Nov 19, 2024
@aruniverse aruniverse changed the title stuck loading while fetching imodels [desktop-viewer] stuck loading while fetching imodels Nov 19, 2024
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