Problem with wix-media.v2 and GetFileDescriptor

So I actually been able to pretty successfully have a Wix page interact with an external API writing it all in an IDE (Visual Studio Code), however I ran into the problem where getFileDescriptor errors out on the published page.

Its purpose was to fetch the static url link of a file in the media manager that was uploaded via an upload button so it could be displayed externally (such as in an email), this works fine during test preview but in the publish preview, and, live page, the console log says the following:

 Error: message: 'INVALID_ARGUMENT: '
details:
validationError:
fieldViolations: []

I’m not sure what this means or what I should do, since the error in itself is pretty vague, and even then, if it was an invalid argument, wouldnt it have told me this in the preview?

I did try moving the request to a backend file, export that to the frontend, and call it but that yielded the exact same result, this also seems to screw with Visual Studio Code’s since it now thinks the imported module has no type ([import { files }] shows just as [any])
Any help is appreciated

Are you able to share the code that you’ve used?

You’re right that it needs to be run on the backend :slight_smile: It will also need it’s permission elevating to be used.

I’d recommend reading the docs for a little more info about how to work with the API - Get File Descriptor | Velo