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

Redirect issue when using baseURL #1583

Closed
sidharthv96 opened this issue May 29, 2021 · 1 comment
Closed

Redirect issue when using baseURL #1583

sidharthv96 opened this issue May 29, 2021 · 1 comment

Comments

@sidharthv96
Copy link
Contributor

sidharthv96 commented May 29, 2021

Describe the bug
This issue only happens when a site

  • is deployed with paths.base config set
  • a non root page is opened directly

https://example.com/base-path/test will load, but the URL will be rewritten to https://example.com/test.
So, when we refresh the page or copy paste the URL, the wrong path will be used resulting in 404.

I have identified the issue in

history.replaceState({}, '', `${info.path}${location.search}`);
and will raise a PR.

Logs
None

To Reproduce

  • Set paths.base in config
  • Deploy with static adapter
  • Open url
  • Refresh

Expected behavior
URL stays https://example.com/base-path/test

Information about your SvelteKit Installation:

Diagnostics

System:
OS: macOS 11.3
CPU: (8) x64 Apple M1
Memory: 35.36 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.1 - ~/.volta/tools/image/node/14.16.1/bin/node
Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
npm: 7.11.2 - ~/.volta/tools/image/npm/7.11.2/bin/npm
Browsers:
Brave Browser: 90.1.24.86
Chrome: 90.0.4430.212
Firefox: 86.0
Safari: 14.1
npmPackages:
@sveltejs/kit: ^1.0.0-next.109 => 1.0.0-next.109
svelte: ^3.34.0 => 3.38.2

adapter: static

Severity
Blocking your usage of SvelteKit entirely.
Currently trying to hotfix the build output to fix the issue.

Medium

Used trailingSlash: 'ignore' to fix issue in my repo.

sidharthv96 added a commit to sidharthv96/kit that referenced this issue May 29, 2021
sidharthv96 added a commit to sidharthv96/kit that referenced this issue May 29, 2021
sidharthv96 added a commit to sidharthv96/kit that referenced this issue May 29, 2021
@benmccann
Copy link
Member

Closing due to lack of response on #1584 where it was unclear whether there's still an issue

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