`export` command swallows errors
Describe the Bug
Whenever an error is thrown during export, the error message is not printed to the user.
Which package is affected (leave empty if unsure)
react-email
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/new-bush-cd6cht?file=%2Femails%2FDemo_Receipt.tsx%3A5%2C3
To Reproduce
Throw an error in a component or take a look at my repro: https://codesandbox.io/p/sandbox/new-bush-cd6cht?file=%2Femails%2FDemo_Receipt.tsx%3A5%2C3
Expected Behavior
I worked around it by adding a try-catch with a console.error and a rethrow in export command.
What's your node version? (if relevant)
No response
HI @hasparus,
I think a better description will be
"Whenever an errror is thrown during export, the error message is not printed to the user and it remains stuck in the "preparing files..." stage without providing any feedback to the user"
That is the problem you are referring to if I understand you clearly.
This led me down to many rabbit holes. Thanks for pointing this out. Confirmed as an issue. For me it's
ReferenceError: React is not defined
Same issue here. Export is stuck on Preparing files... where the underlying problem is React is not defined
After installing the project and testing with SendGrid SDK I get stuck on "â ¼ Preparing files..." when attempting to export.
this is still hapenning
Can you maybe elaborate more on this @TomasSestak? The original problem with esbuild errors not being given as feedback were solved and should not be happening anymore. Would be awesome if you give any kind of reproduction too, thanks!
@gabrielmfern oh maybe this was because i was forced to use 0.0.18 because of some other issue. So maybe it is fixed in 0.0.19?
@gabrielmfern oh maybe this was because i was forced to use 0.0.18 because of some other issue. So maybe it is fixed in 0.0.19?
Are you talking about create-email versions? If so, yeah the 0.0.18 sets up using an older version of the react-email CLI which could have persisted the problem for you. And the latest 0.0.19 had a regression we fixed and are still trying to find time to publish the fix on npm as well.