react-email icon indicating copy to clipboard operation
react-email copied to clipboard

`export` command swallows errors

Open hasparus opened this issue 3 years ago • 8 comments

Describe the Bug

Whenever an error is thrown during export, the error message is not printed to the user.

image

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

hasparus avatar Jul 10 '23 17:07 hasparus

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.

lordelogos avatar Jul 10 '23 18:07 lordelogos

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

kevinmanase avatar Jul 10 '23 19:07 kevinmanase

Same issue here. Export is stuck on Preparing files... where the underlying problem is React is not defined

mvdve avatar Jul 24 '23 10:07 mvdve

After installing the project and testing with SendGrid SDK I get stuck on "â ¼ Preparing files..." when attempting to export.

coreybruyere avatar Sep 28 '23 18:09 coreybruyere

this is still hapenning

TomasSestak avatar Dec 05 '23 14:12 TomasSestak

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 avatar Dec 05 '23 17:12 gabrielmfern

@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?

TomasSestak avatar Dec 05 '23 17:12 TomasSestak

@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.

gabrielmfern avatar Dec 05 '23 18:12 gabrielmfern