fix(preview-server): requiring peers to also have matching esbuild versions#2971
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/react-email/src/utils/preview/start-dev-server.ts">
<violation number="1" location="packages/react-email/src/utils/preview/start-dev-server.ts:146">
P2: `esmResolve()` returns the module entry path (like `.../bin/esbuild`), so joining `subpath` again produces a non-existent path and prevents `ESBUILD_BINARY_PATH` from being set. Use the entry file’s directory before appending `subpath` so the binary can be found and the OSS-400 fix works.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const candidateBinaryPath = path.join( | ||
| await fs.realpath(esbuild.esmResolve(platformPackage)), | ||
| subpath, |
There was a problem hiding this comment.
P2: esmResolve() returns the module entry path (like .../bin/esbuild), so joining subpath again produces a non-existent path and prevents ESBUILD_BINARY_PATH from being set. Use the entry file’s directory before appending subpath so the binary can be found and the OSS-400 fix works.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/react-email/src/utils/preview/start-dev-server.ts, line 146:
<comment>`esmResolve()` returns the module entry path (like `.../bin/esbuild`), so joining `subpath` again produces a non-existent path and prevents `ESBUILD_BINARY_PATH` from being set. Use the entry file’s directory before appending `subpath` so the binary can be found and the OSS-400 fix works.</comment>
<file context>
@@ -139,34 +139,21 @@ export const startDevServer = async (
- nodeModulesDir,
- platformPkg,
- 'package.json',
+ const candidateBinaryPath = path.join(
+ await fs.realpath(esbuild.esmResolve(platformPackage)),
+ subpath,
</file context>
| const candidateBinaryPath = path.join( | |
| await fs.realpath(esbuild.esmResolve(platformPackage)), | |
| subpath, | |
| const candidateBinaryPath = path.join( | |
| path.dirname(await fs.realpath(esbuild.esmResolve(platformPackage))), | |
| subpath, | |
| ); |
Summary by cubic
Auto-set ESBUILD_BINARY_PATH to the platform-specific esbuild binary resolved alongside the used esbuild JS to prevent crashes from version mismatches in monorepos. Applies only when safe, so projects don’t need to pin esbuild to the server’s version.
Written for commit 0f5843b. Summary will update on new commits.