You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
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.
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
polka()// You can also use Express.use('/[sapper-site]',// <------- Add this line
(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
The text was updated successfully, but these errors were encountered:
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?
On Aug 30, 2019, 1:54 PM -0500, Conduitry ***@***.***>, 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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The text was updated successfully, but these errors were encountered: