-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use @react-email/components with Cloudflare #1508
Comments
Please, make a proper minimal reproduction here. This might be caused by various things and to properly narrow down what is wrong, I wanted something that I could quickly use to reproduce your issue. |
Hey @gabrielmfern
|
What version of render are you on? |
the newest version of render, I also tried with
and
|
Got a reproduction going, and it seems like installing the individual packages makes the error go away. Not sure exactly what might be causing this, if it's the exports that components does, or if it's because of Tailwind itself being so large at the moment. Does not seem related to |
Any ETA for #1383 to complete? I'm also facing the same issue with Cloudflare pages, it is related to the Tailwind package too large. The size of the script already exceeded 3 MB and can't deploy it to Cloudflare pages. |
Having the same problem here when deploying to Cloudflare Pages:
I believe some work is being done in the global scope and I'm not sure what justifies that. |
For those looking for a fix, I'd suggest lazy importing every component. const Body = lazy(async () => {
return { default: (await import("@react-email/components")).Body };
}); This way, they won't bloat the global scope, resulting in faster startup, which makes sense whether this gets fixed or not. |
Importing components individually instead of via import { Section } from '@react-email/section'
import { Body } from '@react-email/body'
import { Container } from '@react-email/container'
import { Img } from '@react-email/img'
import { Head } from '@react-email/head'
import { Preview } from '@react-email/preview'
import { Tailwind } from '@react-email/tailwind'
import { Html } from '@react-email/html'
import { Text } from '@react-email/text'
import { Link } from '@react-email/link' |
We just merged #1383 and released it under canary, |
Describe the Bug
I keep getting error with Publish to Cloudflare Pages with Github Actions when using the
@react-email/components
.Which package is affected (leave empty if unsure)
@react-email/components
Link to the code that reproduces this issue
no link
To Reproduce
Code
Expected Behavior
Expecting for deploy to work or output more helpful error?
What's your node version? (if relevant)
v20.10.0
The text was updated successfully, but these errors were encountered: