blindChicken
blindChicken
CDCloudflare Developers
Created by blindChicken on 6/18/2024 in #pages-help
Web-components not rendering.
I have an app built with Remix/Vite, that uses web-components for several keys elements on the page (eg: logo, graphics, buttons). None of the elements render when the app is deployed on Pages, but everything works as expected locally with wrangler dev. So far as I can tell the issue appears to be that the web-components' js files are not being imported correctly. The web-components are wrapped in a React component that uses suspense and lazy to only load the files on the client. My debugging shows that is functioning correctly. The files all appear in the "Assets uploaded" section of the CF-Dashboard. There are two versions of each one with a random hash and one without. The hashed-file code looks like this (file: web-component-logo_SOmEhAsh.js)
const o="/web-component-logo.js";export{o as default};
const o="/web-component-logo.js";export{o as default};
And the file appears in the browser network tab after it is called by the client. The other file doesn't ever appear in network tab (so is never loaded, and I assume the source of the problem) Not sure if this is an issue with CF-Pages or Remix/Vite.
2 replies
CDCloudflare Developers
Created by blindChicken on 5/8/2024 in #workers-help
Service Binding Error "This Worker no longer exists"
My service binding, in settings, is showing this error message: This Worker no longer exists and can not be used. Please try using a different Worker. But the worker does exist and if I make a browser request to the worker it returns the expected response, and everything looks fine in its logs. I'm trying to bind to the worker from pages. When I make a request through the calling website the pages log shows this:
js"worker error:",
"TypeError: The RPC receiver does not implement the method \"emailFunc\"."
js"worker error:",
"TypeError: The RPC receiver does not implement the method \"emailFunc\"."
But again the worker does implement the method.
4 replies
CDCloudflare Developers
Created by blindChicken on 5/6/2024 in #pages-help
Call worker from pages
I have a really simple website (remix) built and deployed with pages. I have contact form that when submitted sends an email. Currently I have it setup so that there is a worker running on different domain, and when the form is submitted my action function makes a request to the other domain and the worker on that domain sends the message. My question is, is there a way to call email send script/worker directly such that it can all be hosted on a single domain. I would set up all the required bindings and so on. Basically, can I call my mailer.js script from inside a remix function?
5 replies
CDCloudflare Developers
Created by blindChicken on 5/6/2024 in #pages-help
Failed Deployment
Similar to this post: https://discord.com/channels/595317990191398933/1236032759923736668 I have tried deploying in vain, the deploy succeeds when using npm run deploy but ultimately fails with no logs or indication of the is causing the problem. The deployment id for the last deploy is 554ebc67-f85b-433f-8e65-9a9a53ea0259
36 replies
CDCloudflare Developers
Created by blindChicken on 5/1/2024 in #workers-help
Can't send email from a worker.
I'm trying to send emails from a worker, I'm following the example in the docs, but I can't get it to work and I don't understand so parts of the code. I'm following the example here: https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/ The my main issue right now is this:
try {
await env.SEB.send(message);
} catch (e) {
return new Response(e.message);
}
try {
await env.SEB.send(message);
} catch (e) {
return new Response(e.message);
}
What is SEB and where does it come from? I assume it stands for Send Email Binding. But when I replace it with the binding defined in my wrangler.toml it throws a not a function error, which is not a surprise as the binding is just object of strings. The other examples provided in the docs, all start from message object, and simply reply or forward it. Where is message object created and then sent?
4 replies