Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESM modules resolution error #233

Closed
Athorcis opened this issue Oct 29, 2023 · 1 comment · Fixed by #234
Closed

ESM modules resolution error #233

Athorcis opened this issue Oct 29, 2023 · 1 comment · Fixed by #234

Comments

@Athorcis
Copy link
Contributor

Hello,

When loading SPX on a server without URL rewriting and thus having a php file inside a URL, the UI won't load because some of the JS files fail to load. The files that won't load are the ones that are imported inside ESM modules, the reason is : the different algorithms used for resolution, on script tags, relative paths are relative to the current page (which includes the filename) but inside an ESM module, relative paths are relative to current file directory (but since there is no rewriting, no PHP script is loaded and the js does not load)

Would you accept a PR that replaces current import directives with dynamic import ?

image image
@NoiseByNorthwest
Copy link
Owner

It sounds like an improvement without downsides, so I'm OK.

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 a pull request may close this issue.

2 participants