-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
Description
Related plugins
Describe the bug
i'm having a monorepo where i build a backend app and i need jsx/tsx to work to render emails. i've setup the email part as a lib package of my monorepo. the package is symlinked, included at the build and works great except for this one thing: tsx files are missing import * as React from 'react' and therefore the code breaks.
Reproduction
https://github.com/y-nk/repro-965
Steps to reproduce
git clone https://github.com/y-nk/repro-965
cd repro-xxxx
pnpm i
pnpm --filter="@test/app" build
cat app/dist/lib/src/email.jsthe email file should be missing the React import line which is commonly injected otherwise.
System Info
System:
OS: macOS 26.0.1
CPU: (8) arm64 Apple M2
Memory: 16.00 GB
Binaries:
Node: 22.16.0
pnpm: 10.13.1Used Package Manager
pnpm
Notes
i have included a few elements of context (email rendering lib) to highlight that the usecase is strong, as well as why i'm using the swc version in the vite.config.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.