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

Unable to load jsx-email.config #257

Closed
dan-smt opened this issue Dec 2, 2024 · 3 comments
Closed

Unable to load jsx-email.config #257

dan-smt opened this issue Dec 2, 2024 · 3 comments

Comments

@dan-smt
Copy link

dan-smt commented Dec 2, 2024

Expected Behavior

console log html & plaintext

Actual Behavior

Terminal error:

⨯ Error: Cannot find module '/Users/code/jsx-email-issues-reproduction/render-function-unable-to-load-config/jsx-email.config.mjs'
    at /Users/code/jsx-email-issues-reproduction/render-function-unable-to-load-config/.next/server/app/(app)/page.js:25:11
    at sendEmail (./src/app/(app)/actions.tsx:22:18)

Additional Information

To test install dependencies then run pnpm dev, this will start nextjs, then click the only button on the top left of the screen

I've tracked the issue down to the render function specifically, interesting behaviour:

  1. comment out render,
  2. run code with renderPlainText
  3. add back in render
  4. it works

maybe it completely ignored the config here? not sure

@shellscape
Copy link
Owner

This is due to next.js in dev mode bundling/loading the wrong lilconfig version which does not have the necessary webpack considerations in its source. Tailwindcss is the culprit here and there's a pending PR here: tailwindlabs/tailwindcss#14029

Temporary workaround is not to use a jsx-email.config file, will keep working on a better solution.

@dan-smt
Copy link
Author

dan-smt commented Dec 3, 2024

For anyone reading: you can pass in the same render options you would put in the config as a second parameter on the render function, and it'll work the same way

@shellscape
Copy link
Owner

I think this one is good to go now that tailwind updated. next.js could still potentially be an issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants