Widgets playground cannot fetch resource
I am following the documentation [1] to test my custom widget in the Widgets playground. Whenever I try to load my custom widget I get a balloon with NetworkError when attempting to fetch resource, and I don't even see a request coming in in my localhost server. This server is serving through https, and I can access it by going to https://localhost:port directly without any problems.
I am serving the contents of my folder that contains just index.html, index.js, and manifest.json. Zipping that folder and uploading it as a custom widget does work - but is too much of a hassle for development - so I am quite sure that my widget itself is working correctly.
Any tips for setting this widget up in the Widgets playground?
1. https://www.jetbrains.com/help/youtrack/devportal/test-custom-widgets.html
Please sign in to leave a comment.
Hi there.
First thing to check is browser console. Does it reveal any errors then you're trying to upload the widget?
The browser console shows the following errors:
1. Cross Origin Request blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:8080/manifest.json. (Reason: CORS request did not succeed). Even though I have added localhost:8080 (and https://localhost:8080) to the allowed origins in the Global settings of my YouTrack server.
2. TypeError: NetworkError when attempting to fetch resource.
3. Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
So it means something is messing up CORS headers in your environment.
Is there a reverse proxy installed in front of YouTrack? Nginx, Apache, or IIS maybe?
Not that I know of. I'm on a free plan, using .myjetbrains.com to access the YouTrack server.
That means we can safely rule server-side configuration issues out.
The next thing to check is a webpack server config file, which is responsible for CORS headers on the local machine. Do you have one? If you do, what's inside and where it resides?