CORS error when using DefaultViewer

We are using DefaultViewer to render 3d objects.

import * as BabylonViewer from '@babylonjs/viewer';

const viewer = new BabylonViewer.DefaultViewer(domElement, {
    scene: {
      debug: false,
    },
    camera: {
      behaviors: {
        autoRotate: 0,
        framing: {
          type: 2,
          zoomOnBoundInfo: true,
          zoomStopsAnimation: false,
        },
      },
    },
    model: {url},
  });

We are getting these errors on prod suddenly as of this week:

Access to XMLHttpRequest at ‘Babylon Viewer: simplifying viewing 3D models in web and native apps’ from origin [our prod url] has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.Understand this errorAI
render_babylon.ts:520
GET Babylon Viewer: simplifying viewing 3D models in web and native apps net::ERR_FAILED 301 (Moved Permanently)

Access to XMLHttpRequest at ‘Babylon Viewer: simplifying viewing 3D models in web and native apps’ from origin [our prod url] has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.Understand this errorAI
render_babylon.ts:520
GET Babylon Viewer: simplifying viewing 3D models in web and native apps net::ERR_FAILED 301 (Moved Permanently)

It seems that the default env and skybox used by DefaultViewer are no longer available. Is this a known issue? It seems to be getting the URL from here Babylon.js/packages/tools/viewer-legacy/src/configuration/types/extended.ts at 2204104892c95670f268897441f3c49b8009281d · BabylonJS/Babylon.js · GitHub - is that URL no longer valid?

cc @ryantrem

There was a DNS change that caused this. It should be working now.

1 Like

Thank you it’s working now!!

1 Like