-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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] strip paths.base
before resolving assets in preview server.
#2409
Conversation
🦋 Changeset detectedLatest commit: 19c170b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
paths.base
from all requests in preview mode.paths.base
before resolving assets in preview server.
@Karlinator can you rebase this PR? |
e34a1eb
to
452eed4
Compare
452eed4
to
ad99e9e
Compare
Sure thing! Prettier is being weird for me right now. It doesn't agree with itself between the CI Lint and running |
I've noticed static assets are available both at |
Hmm. Honestly, I'd love to just get rid of all this stuff and call Vite's preview functionality. It looks like their |
I mean I don't disagree. But I think the base path stuff would still be a problem (we apparently have bugs in the dev server about this, see #2465 as you know). However, right now we are basically supporting two quite separate and different servers for preview and dev which isn't great. |
Yeah, if there are issues in the dev server that's probably the more important one to fix since it's more used and will stick around longer. This maybe wouldn't be worth as much effort if the code were all about to be rewritten, but that would depend on vitejs/vite#5014 and I don't know how long that'd take or if it will even be accepted, so probably worth getting this in still |
I won't spend any more time trying to improve/clean up this until we know the outcome of vitejs/vite#5014 then. Hopefully we can just rip this all out soon-ish. |
I am getting the following error when building, starting with version 171:
|
The preview server was implicitly assuming that asset URLs would never start with the base path. In fact, they always do.
Vaguely related to #2230 (but this was a new issue I discovered and diagnosed while working on #2407).
Before submitting the PR, please make sure you do the following
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0