Tolmieme
01/10/2024, 7:03 AMbirensz
01/10/2024, 12:51 PMjshuff
01/10/2024, 1:04 PMhzia
01/10/2024, 2:38 PMts
fetch('WORKER_URL', {method: 'GET'}).then((response) => response.json()).then((json) => {
console.log(json);
}).catch((error) => {
console.error(error);
});
My worker is currently just default with the Response Hello world due to not knowing what to do.colearendt
01/11/2024, 2:36 AMcurl -i https://cdn.btst.io/test.html
HTTP/2 200
date: Thu, 11 Jan 2024 02:34:45 GMT
content-length: 0
access-control-allow-origin: *
vary: Origin
access-control-allow-credentials: true
access-control-allow-headers: Content-Type, Vary, Origin, Referer, User-Agent, Authorization
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, PATCH, HEAD
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8OA78wCnvcRLW8CC5ljmtce%2BUhoPFbwNekVtEOQFJR2pMlYT5PVokesuCbId8U2u05wrqi3%2FkxP3kUy3K92R%2BvEg3w7XGcMk5vQraiHBgoKxbYMbUfBYchbrM4woyQ%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8439c3330d605cae-RDU
alt-svc: h3=":443"; ma=86400
I don't know how long this has been happening, but I don't see any evidence reported anywhere?
Is this an issue on y'all's side?98thpixel
01/11/2024, 4:45 AMendymion1818
01/11/2024, 11:03 AM${env.SECRET_NAME}
and {context.env.SECRET_NAME}
, neither of which is resolving.
Does anyone know what might be the issue? Since the documentation mentions both approaches, I am suspicious that either might be incorrect.sik.page
01/11/2024, 12:37 PMvinomancer
01/11/2024, 1:37 PMendymion1818
01/11/2024, 2:22 PMpara.doxical
01/11/2024, 4:31 PMendymion1818
01/11/2024, 4:48 PMexport default
causes the error
Error: No routes found when building Functions directory
endymion1818
01/11/2024, 5:08 PM<form method="POST" action="/functions/send-email"
However Wrangler keeps erroring with "No response"
My function is:
export async function onRequest() {
return Response.redirect('/')
}
Please tell me what I'm doing wrongrust
01/11/2024, 11:20 PMts
await writer.write(encoder.encode('<h1>Hello world!</h1>'));
Is this the right way of appending strings or is it possible to remove the encoder.encode
call of the TextEndoer
?vikiival | KodaDot
01/12/2024, 10:36 AMendymion1818
01/12/2024, 12:16 PMmitya2364
01/12/2024, 1:42 PM--remote
flag active. If I quit and restart the server, all is fine.
Is this is a known issue, and should I be concerned about this ultimately happening when I host my app for production?ACS
01/13/2024, 3:20 AMrajiv 🍉
01/13/2024, 12:15 PMAlka
01/13/2024, 4:30 PM.crossbeau
01/13/2024, 5:57 PMjax16276
01/13/2024, 6:49 PMzank.it
01/13/2024, 10:13 PM_middleware.ts
file (code on first comment), having "@cloudflare/pages-plugin-mailchannels": "^0.1.2"
on the dependencies
- On the form I added the attribute data-static-form-name="contact"
- Added includes to my existing spf record so now look like this v=spf1 include:_spf.mx.cloudflare.net include:relay.mailchannels.net include:_spf.google.com -all
- Generated DKIM Credentials following the guide https://developers.cloudflare.com/pages/functions/plugins/mailchannels/#generate-dkim-credentials
- Added to environment variables (see image)
- Added the TXT record mailchannels._domainkey (see image)
- Added domain lockdown (TXT _mailchannels
) with both workers domain and my domain as stated here https://community.cloudflare.com/t/introducing-mailchannels-domain-lockdown/523913/5: `v=mc1 cfid=majestico.workers.dev cfid=majestico.it `(and see image)
Now when i try to send email from https://majestico.it/contact/ I get the error "Could not send your email. Please try again."
Am I missing something?
Is there a way to debug this problem and get a significant error?
ThanksGtadictos21
01/13/2024, 10:22 PM.darkardon
01/14/2024, 12:47 AMCharles Stover
01/14/2024, 2:17 AMzank.it
01/14/2024, 2:50 PMjs
import mailChannelsPlugin from "@cloudflare/pages-plugin-mailchannels";
export const onRequest: PagesFunction = (context) => {
var data = context?.data; // <-- That's just a test
return mailChannelsPlugin({
personalizations: [
{
to: [{ name: "Giulio Zanchetta", email: "giulio.zanchetta@majestico.it" }],
dkim_domain: "majestico.it",
dkim_selector: "mailchannels",
dkim_private_key: context.env.DKIM_PRIVATE_KEY,
},
],
from: {
name: `${data?.name}`, // <-- Here I want the actual name inserted in the form
email: "no-reply@majestico.it",
},
respondWith: () =>
new Response(null, {
status: 302,
headers: { Location: "/thank-you" },
}),
})(context);
};
thatbeanlady
01/14/2024, 3:20 PMthatbeanlady
01/14/2024, 7:32 PMmr.goodman
01/14/2024, 9:24 PMerror code: 521