cinstitute
cinstitute
CDCloudflare Developers
Created by cinstitute on 11/15/2024 in #pages-help
SvelteKit build causing MIME type errors on Cloudflare Pages with adapter. 500 Internal Error
Hey yall, not sure what is going on but my I've been trying to build my app for Cloudflare pages (which was working no more than a week ago) and suddenly my page deployments aren't loading. Console reveals the errors shown below. I have SSR turned off but that's about as much configuring as I've done to the build system (besides of course using the Cloudflare adapter for builds). Even weirder is that when I run npm run preview the local serving of the page works no problem. No idea what is causing this or how to fix it. Any ideas?
The resource from “https://[MYPAGE].pages.dev/_app/immutable/assets/0.DHByXPFT.css” was blocked due to MIME type (“”) mismatch (X-Content-Type-Options: nosniff).
[MYPAGE].pages.dev
Uncaught (in promise) Error: Unable to preload CSS for https://[MYPAGE].pages.dev/_app/immutable/assets/0.DHByXPFT.css
a Immutable
app.Blzu09J3.js:2:2608
Loading module from “https://[MYPAGE].pages.dev/_app/immutable/nodes/2.DINvMMQD.js” was blocked because of a disallowed MIME type (“”).
slushing300x.pages.dev
TypeError: error loading dynamically imported module: https://[MYPAGE].pages.dev/_app/immutable/nodes/2.DINvMMQD.js
The resource from “https://[MYPAGE].pages.dev/_app/immutable/assets/0.DHByXPFT.css” was blocked due to MIME type (“”) mismatch (X-Content-Type-Options: nosniff).
[MYPAGE].pages.dev
Uncaught (in promise) Error: Unable to preload CSS for https://[MYPAGE].pages.dev/_app/immutable/assets/0.DHByXPFT.css
a Immutable
app.Blzu09J3.js:2:2608
Loading module from “https://[MYPAGE].pages.dev/_app/immutable/nodes/2.DINvMMQD.js” was blocked because of a disallowed MIME type (“”).
slushing300x.pages.dev
TypeError: error loading dynamically imported module: https://[MYPAGE].pages.dev/_app/immutable/nodes/2.DINvMMQD.js
1 replies
CDCloudflare Developers
Created by cinstitute on 10/31/2024 in #general-help
Email worker forwarding emails twice?
hey yall. im attempting to set up a catch-all worker to forward "+" emails to their respective custom addresses. for example i have the custom address [email protected] forwarding to [email protected]. i wrote a worker to catch addresses like [email protected] and forward said email to [email protected]. the good news is it works! but maybe a little too much. all the emails are coming in twice at the same time. not sure what im doing wrong or if i have my setup weird. any ideas? note the emails used here are verified and i have both the catchall and my custom emails online.
export default {
async email(message, env, ctx) {
// Extract the local part and domain of the email address
const [localPart, domain] = message.to.split('@');

// List of existing custom addresses (anonymized)
const customAddresses = {
'alias1': '[email protected]',
'alias2': '[email protected]',
'support': '[email protected]',
};

// Only proceed if the local part contains a '+'
if (localPart.includes('+')) {
// Extract the base address (portion before the '+')
const baseAddress = localPart.split('+')[0];

// Check if the base address is in the custom addresses list
const destination = customAddresses[baseAddress];
if (destination) {
// Forward to the appropriate destination
await message.forward(destination);
} else {
// Reject if base address is not recognized
message.setReject(`No such address: ${baseAddress}@${domain}`);
}
}
}
}
export default {
async email(message, env, ctx) {
// Extract the local part and domain of the email address
const [localPart, domain] = message.to.split('@');

// List of existing custom addresses (anonymized)
const customAddresses = {
'alias1': '[email protected]',
'alias2': '[email protected]',
'support': '[email protected]',
};

// Only proceed if the local part contains a '+'
if (localPart.includes('+')) {
// Extract the base address (portion before the '+')
const baseAddress = localPart.split('+')[0];

// Check if the base address is in the custom addresses list
const destination = customAddresses[baseAddress];
if (destination) {
// Forward to the appropriate destination
await message.forward(destination);
} else {
// Reject if base address is not recognized
message.setReject(`No such address: ${baseAddress}@${domain}`);
}
}
}
}
4 replies