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

navigation to pages with iframes with relative URLs are broken after #4070 #4177

Closed
rgossiaux opened this issue Mar 2, 2022 · 2 comments · Fixed by #4191
Closed

navigation to pages with iframes with relative URLs are broken after #4070 #4177

rgossiaux opened this issue Mar 2, 2022 · 2 comments · Fixed by #4191
Labels
bug Something isn't working
Milestone

Comments

@rgossiaux
Copy link

rgossiaux commented Mar 2, 2022

Describe the bug

  • You have a page at "/foo/bar" which loads an iframe whose source is the relative URL "baz" (the absolute URL is thus "/foo/baz")
  • You navigate from "/foo" to "/foo/bar"
  • The iframe loads with the wrong relative URL--it should load with the relative URL of the page it's on (so "/foo/baz") but instead it loads relative to the original page ("/baz")
  • Refresh and everything works; the error is only on navigation.

This is a regression. I bisected the kit version responsible for this and it's 1.0.0-next.285 which looks to correspond to this PR: #4070

Reproduction

You can repro on this branch: rgossiaux/svelte-headlessui#74

  • Clone the repo
  • npm install
  • git checkout upgrade-kit
  • npm run dev
  • Go to the /docs home page
  • Click on Dialog on the sidebar

The iframe will 404. After a refresh it will load.

Logs

No response

System Info

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 5.59 GB / 64.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.8.0 - /var/folders/rn/2kdgb0jj25q2v656j3qc_ywr0000gn/T/fnm_multishells/2969_1644654672256/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 7.21.0 - /var/folders/rn/2kdgb0jj25q2v656j3qc_ywr0000gn/T/fnm_multishells/2969_1644654672256/bin/npm
  Browsers:
    Chrome: 98.0.4758.109
    Safari: 15.2
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.4
    @sveltejs/kit: ^1.0.0-next.285 => 1.0.0-next.285
    svelte: ^3.44.0 => 3.44.3

Severity

blocking an upgrade

Additional Information

No response

@Rich-Harris
Copy link
Member

I expect we could fix this by doing the pushState immediately before root.$set. It might make the code more convoluted, and we should wait until #4161 is merged before tackling it

@rgossiaux
Copy link
Author

Wow, that was fast-- thanks @PH4NTOMiki and @Rich-Harris, you guys are crushing it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants