Open staus opened 5 years ago
I can't reproduce this when serving an exported site locally from a custom base URL. Can you? Or does this only happen on Netlify? What is that _redirects
file intended to do?
I have seen this same issue with Now v2 as well. I abandoned hosting a svelte site next to another using the same deploy for this reason.
Zane Milakovic On Aug 30, 2019, 1:54 PM -0500, Conduitry notifications@github.com, wrote:
I can't reproduce this when serving an exported site locally from a custom base URL. Can you? Or does this only happen on Netlify? What is that _redirects file intended to do? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@Conduitry the netlify file is placed on the root site, to tell it that this folder is another ecosystem. You can read more here: https://www.netlify.com/docs/redirects/ I don't believe that has anything to do with the issue. It's just a technical detail I thought I'd leave in for the setup.
This only happens after I deploy to a server. Locally it seems to redirect fine to the sub folders. Sorry important detail, I'll add it to the issue.
It looks like to me, that there is injected a "client" directory into the url.
That is the correct path to files. After you export, they live at __sapper__/export/[whatever]/client/...
.
I also noticed that in your logs, you're getting 400s, not 404s, which seems to indicate that there's more going on than just the files not being there.
Describe the bug When hosting the site in a sub folder, blog slugs fail to load .css and .js. When testing locally, everything seems to be working. index.svelte and about.svelte work fine and the blog post json content load fine. The only thing that fails is the css and js files. It looks like to me, that there is injected a "client" directory into the url.
To clarify: This works:
This fail:
Logs
GET https://www.[domain].com/[sapper-site]/client/[slug].e85b6711.css net::ERR_ABORTED 400
GET https://www.[domain].com/[sapper-site]/client/[slug].e85b6711.js net::ERR_ABORTED 400
To Reproduce in server.js
In package.json
(configuration for Netlify) In the root/static folder of an existing site, create a file called
_redirects
/[sapper-site]/* https://[sapper-netlify-project].netlify.com/[sapper-site]/:splat 200
Expected behavior Blog posts should just work