Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
This just substitutes the use of
tsc
for build, and uses tsup instead.This also adds specifications for esm and cjs interoperability on the
package.json
sothat imports/requires don't get mixed up.
Why is it necessary?
The missing interoperability between esm and cjs caused problems on next builds
and due to that some issues were openned on
react-email
reporting problems on build.For the record, here is the error that was happening before:
Also, here is the original issue from react-email.
How does this solve the issue?
After investigating for a bit and testing out a few things I found out the problem
was on the Resend SDK, and after searching found out about this issue on NextJS that said this kind of error was due to missing interoperability between esm and cjs.
Besides this evidence, I have tested and confirm this works by copying the dist and substituting the
resend module with the newly compiled one and the build worked on an existing project.