422 Unprocessable Content loading Custom UI in macro module

I am attempting to build a custom UI macro module, the custom UI is build using Vite and my resource is pointing to the distribution folder of the custom app, however when I try to view the macro in Confluence I am getting a 422 error. I have tried adding the ‘unsafe-inline’ and ‘unsafe-eval’ script permissions but still getting the same issue.

It seems to be failing loading the following script

script type=“module” crossorigin src=“/assets/index-BaBB40Qq.js”

Seems that your script src path is absolute (begins with /), but should be relative. Docs state that is should be relative.

I was just fixing similar path-related error (although different status code). See Deploying an Angular application with Forge - #5 by JakubKazimierczak on how I’ve resolved it, might work in your case too.

Best
Kuba