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

Fix: Ensure CSS paths include hostname for remote module styles #667

Merged

Conversation

viguenstepanyan
Copy link
Contributor

@viguenstepanyan viguenstepanyan commented Jan 17, 2025

Description

This PR fixes an issue with CSS loading in remote modules where styles were being loaded from incorrect URLs missing the hostname. Previously, when loading remote module styles, the URLs were constructed without the proper hostname (e.g. //assets/style.css instead of http://hostname/assets/style.css).

The fix improves URL construction logic by:

  • Properly handling both absolute and relative base URLs
  • Preserving hostname when constructing style URLs
  • Adding utility functions for consistent path trimming
  • Ensuring proper URL joining for remote module styles

Additional context

The issue was particularly visible when:

  1. Loading remote module styles in production builds
  2. Using base URLs other than root ('/')
  3. Working with cross-origin remote modules

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@viguenstepanyan viguenstepanyan changed the title Ensure CSS paths include hostname for remote module styles Fix: Ensure CSS paths include hostname for remote module styles Jan 17, 2025
@Dostoynov
Copy link

plz merge ❤️!

@samuelmp
Copy link

Same issue here! merge to be up-to-date!!!

@ruleeeer
Copy link
Collaborator

I will merge and release a version.

@ruleeeer ruleeeer self-requested a review January 18, 2025 11:00
Copy link
Collaborator

@ruleeeer ruleeeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, even the version number was modified for me.

@ruleeeer ruleeeer merged commit e39a86f into originjs:main Jan 18, 2025
8 checks passed
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.

4 participants