Hey, I have finally finished the first version of this website, and everything works perfect when built and hosted by webstudio here:
https://clickett-beta.wstd.io/When I use the CLI to build the project and enter the localhost, a couple things are no longer working.
On the downloads page, I have 5 images pulled from various places externally, such as github links for the 3 large images:
exampleThese are all not showing on the localhost, as well as when hosted on vercel.
Here is the download page working as it should:
https://clickett-beta.wstd.io/downloadHere is the vercel-hosted one not working:
https://clickett.app/download(Just cancel the automatic download)
The 3 problems:
- Images from external links return 404
- Favicon does not load (return 400)
- Downloaded file is null (0 bytes)
I have attached an image of the errors in the console which is the same on the localhost and vercel host
It looks like webstudio has added to the beginning of the original links of the images
This is the code I use for the download:
downloadFile("website.com/file.exe","download name");
function downloadFile(url, fileName) {
fetch(url, { method: 'get', mode: 'no-cors', referrerPolicy: 'no-referrer' })
.then(res => res.blob())
.then(res => {
const aElement = document.createElement('a');
aElement.setAttribute('download', fileName);
const href = URL.createObjectURL(res);
aElement.href = href;
aElement.setAttribute('target', '_blank');
aElement.click();
URL.revokeObjectURL(href);
});
};
I am building using the webstudio CLI on the latest version, and have tried the vanilla and vercel configurations.
Thank you!