-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Does not recognise adapter-vercel build directory #16
Comments
This may be working as intended? The readme specifies this is for static sitemaps, which I understood as meaning all routes are known, but I think it means the site must not be SSR. I probably needed more sleep before raising this issue 😅 I'll leave it in case it helps someone though. For anyone that runs into this "issue" with their SSR site, you should be creating an endpoint (e.g. E.g. import type { RequestHandler } from '@sveltejs/kit';
import { url, pages } from '$lib/constants'; // or wherever your relevant data is
export const get: RequestHandler = async () => {
const headers = {
'Cache-Control': 'max-age=0, s-maxage=3600',
'Content-Type': 'application/xml'
};
const body = `<?xml version="1.0" encoding="UTF-8" ?>
<urlset
xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"
>
<url>
<loc>${url}</loc>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>
${pages
.map(
(page) => `
<url>
<loc>${url}/${page}</loc>
<changefreq>daily</changefreq>
<priority>0.5</priority>
</url>
`
)
.join('')}
</urlset>`
return {
headers,
body
};
}; |
it's odd, I'm trying method from @baisong, but I keep on having these errors:
I made sure the Buld & Developments Settings matches… |
@dev-ofty And have you seen this? #31 (comment) |
@bartholomej Oh thank you, obviously i didn't check enough. Thank you. |
@dev-ofty Just let us know if this is the solution for you ;) If so, I will mention it in readme. |
Issue
svelte-sitemap does not recognise the build directory when using adapter-vercel, regardless of what output directory is provided.
Details
Error
× Make sure you are using this script as 'postbuild' so '.vercel_build_output' folder was successfully created before running this script. See https://github.com/bartholomej/svelte-sitemap#readme
Scripts
Relevant excerpt from
package.json
:Versions
"svelte-sitemap": "^2.1.1"
"@sveltejs/adapter-vercel": "next"
(version "1.0.0-next.28" in yarn.lock)"@sveltejs/kit": "next"
(version "1.0.0-next.159" in yarn.lock)I've tried adding
ls -a
in thepostbuild
script prior to runninggenerate:sitemap
and the output includes.vercel_build_output
, so the directory does existThe text was updated successfully, but these errors were encountered: