unkeyed / unkey

Open source API management platform
https://go.unkey.com
Other
4k stars 468 forks source link

Turborepo causes resend to fail when developing locally #708

Closed MichaelUnkey closed 6 months ago

MichaelUnkey commented 10 months ago

Preliminary Checks

Reproduction / Replay Link (Optional)

No response

Issue Summary

When trying to run resend using our hack I get the following error: `Failed to compile ./src/app/preview/[slug]/page.tsx ReactServerComponentsError:

You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.

The error was caused by importing '@react-email/render/dist/index.mjs' in './src/app/preview/[slug]/page.tsx'.

Maybe one of these should be marked as a client entry "use client": ./src/app/preview/[slug]/page.tsx`

Steps to Reproduce

Nuke Project with: rm -rf ./**/node_modules; rm -rf ./**/.next; rm -rf ./**/.turbo; rm -rf ./**/dist; rm -rf ./**/pnpm-lock.yaml; rm -rf ./**/yarn.lock; rm -rf ./**/.output; rm -rf ./**/.contentlayer; rm -rf ./**/.next; rm -rf ./**/.react-email; rm -rf ./**/.wrangler

pnpm install cd internal/resend pnpm dev -> this fails cd .react-email yarn install cd .. pnpm dev

localhost will launch but on mouseover on menu the error appears.

Expected behavior

I should be able to preview the emails

Other information

No response

Screenshots

No response

Version info

- OS: iOS
- Node: v20.8.1
- npm: v10.1.0
- Browser: chrome
linear[bot] commented 10 months ago

ENG-335 bug: problem with pnpm run on resend