Iven been experimenting with visualizing an iModel using a custom app (not Ion). And for a while it worked fine, until yesterday when the generated token appears to no longer be accepted in the iTwinData.createTilesetFromiModelId() call.
Did something change yesterday?
I now consistently get this error on the following line of code:
const mytiles = await ITwinData.createTilesetFromIModelId
“Uncaught (in promise) RangeError: Invalid array length
at new DynamicEnvironmentMapManager (chunk-K5RKBSQI.js?v=4ea5af89:85967:38)
at new Cesium3DTileset (chunk-K5RKBSQI.js?v=4ea5af89:126203:33)
at Cesium3DTileset.fromUrl (chunk-K5RKBSQI.js?v=4ea5af89:127131:19)
at async fetchToken”
Here is the code snippet:
useEffect(() => {
const fetchToken = async () => {
const returnedData = await fetchGET('https://api.cesium.com/itwin/token');
const { access_token: mytoken } = await returnedData;
setToken(mytoken);
console.log(`Latest token: ${mytoken}`);
ITwinPlatform.defaultAccessToken = mytoken;
const mytiles = await ITwinData.createTilesetFromIModelId('669dde67-eb69-4e0b-bcf2-f722eee94746');
const myurl = mytiles?.resource?.url as string;
setUrl(myurl);
};
fetchToken();
}, []);