Skip to content

docs(website): use local sandbox URL for playground-elements#13075

Closed
ilhan007 wants to merge 1 commit intomainfrom
fix-playground-sandbox-url
Closed

docs(website): use local sandbox URL for playground-elements#13075
ilhan007 wants to merge 1 commit intomainfrom
fix-playground-sandbox-url

Conversation

@ilhan007
Copy link
Contributor

Summary

Always set sandboxBaseUrl to the current origin instead of only in development mode. This makes playground-elements load its resources from local static files instead of unpkg.com CDN.

Problem

Webpack 5.105.0 (#13040) changed how it handles import.meta.url properties - they are now determined at runtime instead of being statically analyzed at compile time. This broke playground-elements which uses dynamic imports with import.meta.url to load resources from unpkg.com:

Uncaught (in promise) Error: Cannot find module 'https://unpkg.com/playground-elements@0.18.1/'

Solution

Since we already have playground-elements static resources copied to website/static/, we can set sandboxBaseUrl to use the current origin for all environments (not just development). This way playground-elements never tries to resolve URLs from unpkg.com.

Benefits

  • Fixes the runtime error without reverting webpack
  • Faster loading - resources served from same origin
  • No CORS issues
  • Works offline
  • Future-proof against webpack changes

@ilhan007 ilhan007 changed the title fix(website): use local sandbox URL for playground-elements docs(website): use local sandbox URL for playground-elements Feb 12, 2026
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Feb 12, 2026

🧹 Preview deployment cleaned up: https://pr-13075--ui5-webcomponents.netlify.app

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 12, 2026 13:52 Inactive
@ilhan007 ilhan007 force-pushed the fix-playground-sandbox-url branch from b2cb058 to 89c9ab3 Compare February 12, 2026 13:53
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 12, 2026 14:00 Inactive
Always set sandboxBaseUrl to the current origin instead of only
in development mode. This makes playground-elements load its
resources from local static files instead of unpkg.com CDN.

This fixes a runtime error caused by webpack 5.105.0's changed
handling of import.meta.url, which broke dynamic imports from
external URLs.
@ilhan007 ilhan007 force-pushed the fix-playground-sandbox-url branch from 89c9ab3 to 1dfde1e Compare February 12, 2026 14:06
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 12, 2026 14:12 Inactive
@ilhan007
Copy link
Contributor Author

  • [ ]

@ilhan007 ilhan007 closed this Feb 12, 2026
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview February 12, 2026 14:59 Inactive
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.

2 participants