2.4.13 loadBundle wouldn't auto search for version without passing in version

When I do not state a hash version, the bundle do not auto find the right version

cc.assetManager.loadBundle(‘http://127.0.0.1:5500/build/web-mobile/assets/vault’, (err, bundle) => { });

I must include the version like this only it’ll work
cc.assetManager.loadBundle(‘http://127.0.0.1:5500/build/web-mobile/assets/vault’, { version: ‘15ede’ }, (err, bundle) => { });

is this a bug? as I see in the document it says it should able to auto find

Thanks


Please check whether the right hash value exists in settings.json.


it has the right hash in setting, but it’s not finding it though


The version you have provided is ‘15ede’, which is different from the screenshot you have provided.

That’s because I already rebuild the project, it won’t find even the numbers are the same
image
image

This is the codes I write to load remote bundle.


Here is the link to Test load bundle. Please check whether the link is correct or not.

Here is the load bundle result:

I couldn’t use the preview link directly as it says CORS, I am using visual studio code’s live server plugin to host the build file instead, I have taken a video of me starting the process from new project, being able to load the project if I provided the version and not able to load when I remove it. Can you see if I’ve done anything wrongly? Thanks

Just have a try to set up a remote resources server to upload the testBundle, that will avoid the CORS. Then click the button below,
image. That the different steps between you and me.

It’s not working whether I host using live server or host it on bitbucket, it only works if I build without the md5 cache or provide it with version number

I’ve uploaded to bitbucket, you can check it
cc.assetManager.loadBundle(‘https://saltemishel.bitbucket.io/testbundle/assets/testbundle’, { version: ‘b06d9’ }, (err, bundle) => {
if (err) {
console.error(“Failed to load bundle:”, err);
return;
}
console.log(bundle)
bundle.load(caca, cc.Prefab, function (err, prefab) {

            let newNode = cc.instantiate(prefab);
            newNode.x=100
            newNode.y=100;
            cc.director.getScene().addChild(newNode);
        });


    });

https://saltemishel.bitbucket.io/testbundle/assets/testbundle1/config.b06d9.json, i can not visit the link, it shows the file is not found. Please make sure the resources can be viewed in browser.

https://saltemishel.bitbucket.io/testbundle/assets/testbundle/config.b06d9.json

the testbundle should be without the 1 I’m not sure why there’s a
image
in the end of my link in the post


I can load the bundle correctly without passing version.

image

I’m using js version of 2.4.13 and can’t add the err=null, bundle=Bundle {_config:Config} to my code

Can you see if my file is working at your side? Thanks

err=null, bundle=Bundle {_config:Config} , that is the callback result from loadbundle.


I can’t put it in my code, it’ll report error

anyway did my project work at your side?