Viewing.Document.Load() -> Error: 500
MiguelG97 opened this issue · 6 comments
Hi folks I've being uploading 3 files so far and the same problem shows up:
All of them already are translated but when it's time to load the document it always triggers the onDocumentLoadFailure:
I was expecting the code to instance a new Document using the data and documentPath. However the acmsession still be undefined:
data:
https://cdn.derivative.autodesk.com/derivativeservice/v2/manifest/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YnJ1eHZ5eXB6czI4cmxkdmllcTNveXViOXFucHRuYXYtYmFzaWMtYXBwLzA0X0NPUlRMQU5EJTIwQVJCT1JFVFVNX0E0LURPTUFJTl9BcyUyMEJ1aWx0JTIwV2Fsa3NoZWV0JTIwKDMpLnJ2dA?domain=http%3A%2F%2Flocalhost%3A8080
documentPath:
"urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YnJ1eHZ5eXB6czI4cmxkdmllcTNveXViOXFucHRuYXYtYmFzaWMtYXBwLzA0X0NPUlRMQU5EJTIwQVJCT1JFVFVNX0E0LURPTUFJTl9BcyUyMEJ1aWx0JTIwV2Fsa3NoZWV0JTIwKDMpLnJ2dA"
any hints on what it might be the root cause of this issue?
Hi @MiguelG97, I'm not sure what could be causing this. Could you try previewing the model in the vscode extension? And if that's not working either, please try and use the extension to retrieve the Model Derivative manifest for the model, and share it here?
Hi @petrbroz! thanks for replying me
vs is behaving wierd since I have my bucket created but it's not showing my files stored hence can't use the vs viewer too
Here I have the manifest:
any comments?
Best regards!
Miguel G
By the way, this is the bucket detail, it was created through the sample code provided in the documentation but it's not visible in the vs viewer.
{
"bucketKey": "bruxvyypzs28rldvieq3oyub9qnptnav-basic-app",
"bucketOwner": "bRuxvYypZS28RldviEQ3oyUb9QnpTNAV",
"createdDate": 1673750948343,
"permissions": [
{
"authId": "bRuxvYypZS28RldviEQ3oyUb9QnpTNAV",
"access": "full"
}
],
"policyKey": "temporary"
}
However, when I use the vs tool to create a new bucket, it shows me perfectly the files in the buckets & derivatives panel
Last but not least, is there any set up we need to do in order to step into the main.js and viewer.js file? Currently it shows unbound breakpoints. And the browser is having a hard time to list the models:
Again, I can't step into the main.js file to look into the app.js (cant located from the browser debug dev tool too)
Any hints that can drive into the right direction would be more than welcome! I have this config in the launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Server",
"runtimeExecutable": "npm",
"runtimeArgs": ["start"],
"envFile": "${workspaceFolder}/.env",
"skipFiles": ["<node_internals>/**/*.js"]
}
]
}
All the best,
Mg
@petrbroz Hi There, hope you are doing well.
Apparently I found the issue and it's related to the viewer.js file.
I defined my method as getAccesToken(callback){...} with 1 "s" instead of "getAccessToken" and it's weird seems the initViewer is the only member that is calling this function so I assumed that It would not be a big deal if I misspell it. But when I turn it back to "getAccessToken" the viewer loads my model.
I also see there are some calls to the "getAccessToken" method in the viewer3D.js file.
So my finding are telling me that we are limitted to use the "getAccessToken" name for this specific function. Is that true??
Best regards,
Miguel G
Hi Miguel, in our sample code we pass the following options to Autodesk.Viewing.Initializer
:
{ getAccessToken }
which is basically a shorthand for
{ getAccessToken: getAccessToken }
You can name the function responsible for retrieving tokens in any way you want, for example, myCustomFunc
, as long as you map it to the getAccessToken
property of the options object:
async function myCustomFunc() { /* ... */ }
Autodesk.Viewing.Initializer({ getAccessToken: myCustomFunc }, function () { /* ... */ });
Thanks for the hints! I'm new to web development. It seems that typescript could've been more helpful to identify that issue
All the best!