-
Notifications
You must be signed in to change notification settings - Fork 789
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(compiler): handle null window.location.origin #2813
fix(compiler): handle null window.location.origin #2813
Conversation
when using a data URI or file URI (ionic-team#2582), or when using iframe's `srcdoc`, the value for window.location.origin can be `null`. In these particular cases, passing `null` to `new URL(url, null)` will throw the following error: Failed to construct 'URL': Invalid base URL
+1, currently blocked by this when using components in an iframe |
As a hotfix, I'm using patch-package to apply this fix on my project's side, while we wait for this PR to be merged and published Not a long term solution but hopefully this can unblock you 😃 |
that's more convenient than editing the file in |
No problem! Glad I could be of help 😄 |
+1, we make use of the patch-package solution for this issue. for @Stencil@[email protected] the patch file is 8.5mb and needs to be checked into our repo. 🥲 will this PR eventually be considered? |
…on.origin-is-null
Bump @rwaskiewicz If this needs some changes to get it over the line, please let me know. We have dozens of stencil projects that all need this fix manually applied so they are compatible with sandboxed iframes and |
e.g. I'm happy to add some test cases to this PR if that will help it get across the line |
Any update on this? |
1 similar comment
Any update on this? |
@rwaskiewicz, please merge these changes or outline any requirements that need to be fulfilled |
@rwaskiewicz Could you take a look? We've used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I have one stylistic nitpick that I think can be applied in GH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to be merging this as an admin - the failing CI step is a known issue when running against forks. The step in question is our tech debt burndown chart, which I'm able to see the output of (no new unused functions or strict null checks violations are added in this PR)
when using a data URI or file URI (#2582), or when using iframe's
srcdoc
, the value for window.location.origin can benull
. In these particular cases, passingnull
tonew URL(url, null)
will throw the following error: Failed to construct 'URL': Invalid base URL