You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using any media query (either pre-defined in tailwind.config.ts or dynamically defined inline) triggers an error:
Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead.
I believe, but am not 100% certain, that this is because https://github.com/resend/react-email/blob/canary/packages/tailwind/src/tailwind.tsx#L68 passes an async callback. This seems unnecessary, as I don't see any awaits? But I might be missing something.
I notice mapReactTree alludes to a future need for this; in any case I believe this is causing the mapping to return promises that are never awaited and thus break the react render.
Describe the Bug
Using the new release, e.g.:
Using any media query (either pre-defined in tailwind.config.ts or dynamically defined inline) triggers an error:
I believe, but am not 100% certain, that this is because https://github.com/resend/react-email/blob/canary/packages/tailwind/src/tailwind.tsx#L68 passes an
async
callback. This seems unnecessary, as I don't see anyawait
s? But I might be missing something.I notice
mapReactTree
alludes to a future need for this; in any case I believe this is causing the mapping to return promises that are never awaited and thus break the react render.Which package is affected (leave empty if unsure)
@react-email/tailwind
Link to the code that reproduces this issue
N/A (see below)
To Reproduce
Something like the following triggers the issue:
Where
desktop:
can also be e.g. inlined asmin-[600px]:
and still reproduce the issue.Note I do not believe a
tailwindConfig
is required to reproduce. This is just pulled from our use case.Expected Behavior
I would expect
Tailwind
to still work with media queries as expected without breaking the render tree.What's your node version? (if relevant)
No response
The text was updated successfully, but these errors were encountered: