Baptistabomb
Baptistabomb
Explore posts from servers
CDCloudflare Developers
Created by Insight on 3/29/2024 in #pages-help
NUXT Your Functions script is over the 1 MiB
how could dev dependencies end up in the functions script folder
5 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
I’m afraid my functions will get higher fast every page takes 60ko maybe I should switch some to use client but I lose SSR
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
Yeah that’s what I did but sadly it means I can’t send react content anymore
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
yeah looks like it's the resend library :/ Argh I loved cloudflare pages, I have my domain there and analytics
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
import { EmailTemplate } from "@/components/emails/FirstEmail";
import { resend } from "@/lib/email/index";
import { emailSchema } from "@/lib/email/utils";
import { NextResponse } from "next/server";

export const runtime = 'edge';

export async function POST(request: Request) {
const body = await request.json();
const { name, email } = emailSchema.parse(body);
try {
const data = await resend.emails.send({
from: "Kirimase <[email protected]>",
to: [email],
subject: "Hello world!",
react: EmailTemplate({ firstName: name }),
text: "Email powered by Resend.",
});

return NextResponse.json(data);
} catch (error) {
return NextResponse.json({ error });
}
}
import { EmailTemplate } from "@/components/emails/FirstEmail";
import { resend } from "@/lib/email/index";
import { emailSchema } from "@/lib/email/utils";
import { NextResponse } from "next/server";

export const runtime = 'edge';

export async function POST(request: Request) {
const body = await request.json();
const { name, email } = emailSchema.parse(body);
try {
const data = await resend.emails.send({
from: "Kirimase <[email protected]>",
to: [email],
subject: "Hello world!",
react: EmailTemplate({ firstName: name }),
text: "Email powered by Resend.",
});

return NextResponse.json(data);
} catch (error) {
return NextResponse.json({ error });
}
}
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
that's not it so that's probably the imports inside my route
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
hmm maybe it's the react import?
import * as React from "react";

interface EmailTemplateProps {
firstName: string;
}

export const EmailTemplate: React.FC<Readonly<EmailTemplateProps>> = ({
firstName,
}) => (
<div>
<h1>Welcome, {firstName}!</h1>
<p>
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim
labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet.
Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum
Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident.
Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex
occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat
officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in
Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non
excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco
ut ea consectetur et est culpa et culpa duis.
</p>
<hr />
<p>Sent with help from Resend and Kirimase :blush:</p>
</div>
);
import * as React from "react";

interface EmailTemplateProps {
firstName: string;
}

export const EmailTemplate: React.FC<Readonly<EmailTemplateProps>> = ({
firstName,
}) => (
<div>
<h1>Welcome, {firstName}!</h1>
<p>
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim
labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet.
Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum
Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident.
Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex
occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat
officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in
Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non
excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco
ut ea consectetur et est culpa et culpa duis.
</p>
<hr />
<p>Sent with help from Resend and Kirimase :blush:</p>
</div>
);
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
I also have in /api/email an email function that takes a string of 25lines and it's 444ko I dont get it
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
I dont know why my middleware function is so large there is barely 125lines of code there
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
56K account
80K account.func.js
544K api
116K castings
52K castings.func.js
156K cron.func.js
44K dashboard.func.js
520K middleware.func.js
48K resend.func.js
48K settings.func.js
44K sign-in
44K sign-up
48K survey.func.js
76K welcome.func.js
56K account
80K account.func.js
544K api
116K castings
52K castings.func.js
156K cron.func.js
44K dashboard.func.js
520K middleware.func.js
48K resend.func.js
48K settings.func.js
44K sign-in
44K sign-up
48K survey.func.js
76K welcome.func.js
19 replies
CDCloudflare Developers
Created by Baptistabomb on 3/16/2024 in #general-help
Error: Failed to publish your Function. Got error: Your Functions script is over the 1 MiB size lim
is it the whole functions folder that must be under 1MB ?
19 replies