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

URLs not ending with file extension can't be loaded by appendSceneAsync() #15793

Closed
hybridherbst opened this issue Nov 8, 2024 · 6 comments
Closed

Comments

@hybridherbst
Copy link

hybridherbst commented Nov 8, 2024

When URLs don't end in a file extension, Babylon doesn't seem to be able to understand the served mime type or headers to determine the correct loader.

Example URL: https://cloud-staging.needle.tools/-/assets/Z23hmXB1tXjQr/1tXjQr/file

Repro

babylon.js?t=1731053735677:1 Uncaught (in promise) RuntimeError: 
Unable to load from https://cloud-staging.needle.tools/-/assets/Z23hmXB1tXjQr/1tXjQr/file: 
importScene of undefined from undefined version: undefined, exporter version: undefined
importScene has failed JSON parse
    at t [as constructor] (babylon.js?t=1731053735677:1:530981)
    at new t (error.ts:76:9)
    at d (sceneLoader.ts:1026:42)
    at Object.load (babylonFileLoader.ts:1056:17)
    at sceneLoader.ts:1063:35
    at f (sceneLoader.ts:643:13)
    at fileTools.ts:526:13
    at XMLHttpRequest.e (fileTools.ts:675:33)

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS 15.1
  • Browser: Chrome, Safari

Additional context

The URLs are served with the correct mime type. Other viewers load the file correctly, e.g.

@deltakosh
Copy link
Contributor

As stated in our issue template please start with the forum

@deltakosh
Copy link
Contributor

deltakosh commented Nov 8, 2024

And here is your fix: https://playground.babylonjs.com/#WGZLGJ#10767

We ask to chat on the forum first so we augment our knowledge base there

@hybridherbst
Copy link
Author

Thanks for the note, I opened issues here in the past just fine so must have overread the new note about the forum.

I still believe this is a bug – it should not be necessary to provide the plugin because the file is served with the correct mime-type. Other viewers support that just fine, see above.

Do you want me to open a new forum post about this nonetheless before you reopen the issue?

@deltakosh
Copy link
Contributor

deltakosh commented Nov 8, 2024

Well we are all different ;)
You can do two things:

  • Open a feature request on the forum (in the feature request category) so people can vote and it helps us prioritize
  • Do the PR and I will gladly merge it

@deltakosh
Copy link
Contributor

deltakosh commented Nov 8, 2024

@hybridherbst #15798 :D

(there was a 3rd option where I actually do the change ;))

@hybridherbst
Copy link
Author

Haha, thanks so much!

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

2 participants