Skip to content
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

Hot Reload not working when modifying components imported in the email files (when using path aliases) #1872

Open
NickTiut opened this issue Jan 20, 2025 · 2 comments
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal. Type: Bug Confirmed bug

Comments

@NickTiut
Copy link

NickTiut commented Jan 20, 2025

Describe the Bug

I have the following file structure:

react-email-bug/
┣ emails/
┃ ┣ _components/
┃ ┃ ┣ footer.tsx
┃ ┃ ┣ layout.tsx
┃ ┗ generic.tsx
┣ node_modules/
┣ package-lock.json
┣ package.json
┗ readme.md

When I modify anything in footer.tsx (or layout.tsx), the dev server outputs ✔ Successfully rendered footer.tsx in 236ms but does not re-render generic.tsx that imports both of those components.

Which package is affected (leave empty if unsure)

react-email

Link to the code that reproduces this issue

https://github.com/NickTiut/react-email-bug

To Reproduce

Run npm run dev on the example provided. Modify anything in the _components/layout.tsx or _components/footer.tsx files. Web client does not update. If you restart the dev server, the changes are picked up.

Expected Behavior

Any change to the components should be reflected instantly on the web client.

What's your node version? (if relevant)

20.4.0

@NickTiut NickTiut added the Type: Bug Confirmed bug label Jan 20, 2025
@gabrielmfern
Copy link
Collaborator

We do support hot reloading for changing files imported into an email template, but we don't support TypeScript's path aliases, that seems to be the issue in your case.

@gabrielmfern gabrielmfern added the Package: react-email This is the CLI we generally use as just `email` on the temrinal. label Jan 22, 2025
@NickTiut
Copy link
Author

@gabrielmfern Thanks for the clarification. Will it be supported in the future? I'm sure path aliases are widely used.

@NickTiut NickTiut changed the title Hot Reload not working when modifying components imported in the email files Hot Reload not working when modifying components imported in the email files (when using path aliases) Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal. Type: Bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

2 participants