Unable to load model from firebase storage in react native

I’m trying to download a model from firebase storage in react native but I get the following error.

const url = “https://firebasestorage.googleapis.com/v0/b/dev-dupspace.appspot.com/o/users%2FA5LzIXCB5DdA88LZrZyY%2Favatars%2F1.glb?alt=media&token=27349af4-a5e1-43dc-a936-c6daafd08104”;

const container = await SceneLoader.LoadAssetContainerAsync(
  url,
  "",
  scene
);

RuntimeError: Unable to load from https://firebasestorage.googleapis.com/v0/b/dev-dupspace.appspot.com/o/users%2FA5LzIXCB5DdA88LZrZyY%2Favatars%2F1.glb?alt=media&token=27349af4-a5e1-43dc-a936-c6daafd08104: LoadFileError: Error status: 404 undefined

I can download the model in the browser and using fetch. It also works fine with the same code on web.

Any ideas?

@bghgary - any transformation on http requests in babylon native?

I debugged it a bit. It looks like a bug in the processing of urls.

The final url it tries to open is: https://firebasestorage.googleapis.com/v0/b/dev-dupspace.appspot.com/o/users%252FA5LzIXCB5DdA88LZrZyY%252Favatars%252F1.glb?alt=media&token=27349af4-a5e1-43dc-a936-c6daafd08104 which is obviously not correct.

@jsuhncc Can you file a GitHub issue?

1 Like

@bghgary was the issue filed?

No, not yet.

Filed one here: URL Processing Bug · Issue #1164 · BabylonJS/BabylonNative (github.com)

2 Likes