Skip to content

Conversation

@letorbi
Copy link

@letorbi letorbi commented Dec 22, 2025

This is a follow up pull request of #70, since the underlying issue has not been fixed with the release of version 1.4.3.

Two problems are fixed with this PR:

1.) Even with version 1.4.3 the index page is not able to load additional JavaScript modules. I see the following errors in the developer console:

Loading module from “https://mail.letorbi.de/assets/index-D-i2oJtH.js” was blocked because of a disallowed MIME type (“text/html”).
Loading module from “https://mail.letorbi.de/assets/vendor-BIhQoEM5.js” was blocked because of a disallowed MIME type (“text/html”).

This originates from Vite, which assumes that all generated paths should originate from the root / (see vitejs/vite#13910).

I was able to fix that behaviour by adding a relative base path ./ to the Vite configuration.

2.) Once the Vite paths have been fixed, the webapp would try to access the API from the root (e.g. https://example.com/api/), even though the page was loaded from a path (e.g. https://example.com/dmarc/).

Since version 1.4.0(?) this can be fixed, by changing the API path in the configuration dialog. However, the loading of the webapp will fail in the first place, which is a bad user-experience.

This PR fixes this problem by adding window.location.pathname to the default API path, which is used, if no explicit path has been set via the configuration dialog. This way the app loads without any problems - even form a path and with no extra configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant