After deployment, can't access website

My page: https://svelte-cfpage.pages.dev/ My deployment ID: (I don't know how to get it) My account ID: 80a06574599d689bb015dc39791e5f22 I don't get any errors. My main problem is that I succcesfully deployed (built) my website from a GitHub repo. After this I don't know what I should do to be able to access my website.
24 Replies
samsam
samsamOP13mo ago
.
QuaqSim
QuaqSim13mo ago
If you look at deployments for the Pages project in Cloudflare, does it list a deployment around the time you would expect? If so, does accessing that deployment specifically show what you expect? (URL should look something like https://a1b2c3.svelte-cfpage.pages.dev)
samsam
samsamOP13mo ago
Yeah, it showed that, and the URL was also something like that, but for some reason when I tried to open it, it said that it doesn't exist https://4facad8c.svelte-cfpage.pages.dev/ Oh wait..
samsam
samsamOP13mo ago
No description
samsam
samsamOP13mo ago
For some reason it only uploaded 1 file How can I fix that?
QuaqSim
QuaqSim13mo ago
Do the build directories match in your project? (Configuration in the dashboard, I think) E.g. if Svelte puts its results into build, does your Pages project use build?
samsam
samsamOP13mo ago
The directories match. I didn't push the built files to GitHub, I thought CF would build it. I guess that is the problem, right?
QuaqSim
QuaqSim13mo ago
Shouldn’t be, but it would need to be configured to perform the build if it isn’t already. E.g. build command might need to be something like npx svelte build (I’m pulling that command out of nowhere, I don’t know Svelte specifically)
samsam
samsamOP13mo ago
On my local computer I can build it with npm run build.
samsam
samsamOP13mo ago
This is my build settings:
No description
samsam
samsamOP13mo ago
GitHub
GitHub - sharkmu/svelte-cfpage
Contribute to sharkmu/svelte-cfpage development by creating an account on GitHub.
QuaqSim
QuaqSim13mo ago
Looks like there is some extra setup needed for Svelte like installing and using a different adapter: https://developers.cloudflare.com/pages/framework-guides/deploy-a-svelte-site#sveltekit-cloudflare-configuration
Deploy a Svelte site · Cloudflare Pages docs
Svelte is an increasingly popular, open-source framework for building user interfaces and web applications. Unlike most frameworks, Svelte is …
QuaqSim
QuaqSim13mo ago
Though looking at that again, I wonder if /dist should be /cfpage/dist, i.e. if it’s building inside there rather than beside it.
samsam
samsamOP13mo ago
🤔 Interesting
samsam
samsamOP13mo ago
No description
QuaqSim
QuaqSim13mo ago
In retrospect, the output directory will be relative to the current working directory, which is changed by root directory. Sorry about that. When you run npm run build locally, are the files you want to upload created in dist?
samsam
samsamOP13mo ago
Umn, no
QuaqSim
QuaqSim13mo ago
Ah, that'll be why then. It looks like you're using SvelteKit based on vite.config.js, which probably means it's building into a .svelte-kit directory or subdirectory.
samsam
samsamOP13mo ago
Oh, I forgot about that
QuaqSim
QuaqSim13mo ago
Also probably means you'll need to complete the setup from my previous link, which also describes the build configuration to use.
samsam
samsamOP13mo ago
Okay, thanks I am currently not at home, but I'll try it out and get back to you
samsam
samsamOP13mo ago
No description
samsam
samsamOP13mo ago
Big change https://6a9f5069.svelte-cfpage.pages.dev/ Still not working.. If I change the adapter to the one you sent, would it work?
QuaqSim
QuaqSim13mo ago
The comments in svelte.config.js for the adapter talk about adapter-auto only supporting some environments and to change it if necessary - I assume Cloudflare is one of the environments it doesn't support and so is necessary to change it. It looks pretty straightforward, an npm install, a minor change to switch the adapter and changing the build configuration as shown a little further down. (Your root directory will need to remain as-is.)
Want results from more Discord servers?
Add your server