This repo contains a basic example of the failure to correctly read the re-exports from the @react-email/components library when using node --experimental-loader=import-in-the-middle/hook.mjs
to load the compiled server code.
yarn install
yarn build
yarn start
- built server will run- Go to http://localhost:3000 and you should see the output "Hello world!"
yarn install
yarn build
yarn start:import
Server will fail to run, generating an error message that indicates that instead of treating the exports as coming from a different node_modules library, it is looking for them as sibling directories of the @react-email/components index.js file:
node:internal/process/esm_loader:40
internalBinding('errors').triggerUncaughtException(
^
[Error: ENOENT: no such file or directory, open '/home/username/project/node_modules/.store/@react-email-components-virtual-daf4c187d9/package/dist/@react-email/body'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/username/project/node_modules/.store/@react-email-components-virtual-daf4c187d9/package/dist/@react-email/body'
}