iampapagray
iampapagray

Reputation: 63

Unable to view preview

I have a NextJs project and i want to integrate react-email. Thus, i use the Manual Setup option in the docs from step 2 to the end. Because i already have a script with dev, i use email: email dev --dir src/emails in the package.json script.

When i open the preview page on localhost:3001 and navigate to the only email i added from the docs, i get this error:

Error: Build failed with 4 errors: emails/my-email.tsx:1:29: ERROR: Could not resolve "@react-email/components" emails/my-email.tsx:7:6: ERROR: Could not resolve "react/jsx-runtime" emails/my-email.tsx:17:33: ERROR: [plugin: rendering-utilities-exporter] Failed trying to importrenderfrom either@react-email/renderor@react-email/componentsto be able to render your email template. Maybe you don't have either of them installed? emails/my-email.tsx:18:72: ERROR: Could not resolve "react"

Even after reinstalling the libraries it still doesnt work. I also tried the manual setup from scratch, exactly as it is in the docs and i get the same problem.

error screenshot

Here are my env details: MacOs 15.1.1 M3 Pro Chip Node v21.6.2 NPM 10.2.4 bun 1.0.26

To Reproduce simply follow steps here: https://react.email/docs/getting-started/manual-setup

Expected Behavior Preview for selected email should be displayed without a hustle.

Upvotes: 0

Views: 53

Answers (0)

Related Questions