Import aliases broken
Describe the Bug
After updating from 4.2.12 to 4.3.1 I am getting the following errors now and the dev server crashes.
Downgrading to 4.2.12 fixes the issue.
Could not find file at /home/<redacted>/Documents/github/<redacted>/src/utils/react-email.utils
[Error: ENOENT: no such file or directory, open '/home/<redacted>/Documents/github/<redacted>/src/utils/react-email.utils'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/<redacted>/Documents/github/<redacted>/src/utils/react-email.utils'
}
Example imports:
import type { PropsWithChildren } from 'react';
import { Body, Container, Head, Html, Img } from '@react-email/components';
import { imageUrl } from '@/utils/react-email.utils';
Which package is affected (leave empty if unsure)
react-email
Link to the code that reproduces this issue
https://github.com/resend/react-email
To Reproduce
Use aliased imports in a react/typescript project.
Expected Behavior
It should work like it did in 4.2.12
What's your node version? (if relevant)
24.3.0
Hello, I would like to work on this bug. Can you assign the issue over to me?
@kazekunal, I do not have permissions to assign issues.
I believe this is the culprit: https://github.com/resend/react-email/commit/1e13d1571760fbd2932cca2ab63e3a74292cfcd6#diff-f31d2a6b7a598d2db124529b4ae5bd9ea79389ca069dcda70fec7945030ba96aR149-R153
Using existsSync does not work with import aliases.
Seems like this has been fixed as of the latest version from what I could reproduce. Since the issue doesn't have a reproduction, I'm going to close this. If anyone still experiences, share a reproduction and let me know so I can reopen.