MicrosoftDocs / mixed-reality

Mixed Reality documentation
Creative Commons Attribution 4.0 International
175 stars 186 forks source link

Issue fetching Piano mesh file due to CORS #454

Open tlahav opened 3 years ago

tlahav commented 3 years ago

Followed tutorial but am seeing this in the browser:

Access to XMLHttpRequest at 'https://docs.microsoft.com/windows/mixed-reality/develop/javascript/tutorials/babylonjs-webxr-piano/filespianoFrame.babylon' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. babylon.js:16

Error originates from: BABYLON.SceneLoader.ImportMesh("frame", "https://docs.microsoft.com/windows/mixed-reality/develop/javascript/tutorials/babylonjs-webxr-piano/files", "pianoFrame.babylon", scene, function (meshes) { const frame = meshes[0]; frame.parent = piano; }); Probably comes from incorrect CORS setup on the file? can someone check?

Thanks


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

JING1201 commented 3 years ago

Thanks for catching this! Feel free to check if the changes in the PR resolves the issue.