Skip to content

fix: react-compiler-runtime should be cjs #31993

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

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Conversation

stipsan
Copy link
Contributor

@stipsan stipsan commented Jan 6, 2025

Summary

The move to esbuild in #31963 is causing build errors in many of our systems due to the changed output format:

perf-studio:build: /vercel/path1/node_modules/.pnpm/react-compiler-runtime@19.0.0-beta-63e3235-20250105_react@18.3.1/node_modules/react-compiler-runtime/dist/index.js:17
perf-studio:build: import * as React from "react";
perf-studio:build: ^^^^^^
perf-studio:build: SyntaxError: Cannot use import statement outside a module
perf-studio:build:     at extensions..js (~/path1/node_modules/.pnpm/esbuild-register@3.6.0_esbuild@0.21.5/node_modules/esbuild-register/dist/node.js:4833:24)

esbuild-register and jest are repeat offenders.

How did you test this change?

The new output with this change is cjs, which is what it used to be and matches what react itself is currently published as.

Copy link

vercel bot commented Jan 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 6, 2025 10:43am

@poteto poteto merged commit 9627d71 into facebook:main Jan 6, 2025
18 checks passed
poteto added a commit that referenced this pull request Jan 16, 2025
Alternative to #32071. As a follow up to #31993, the `platform` target was incorrectly being set to `browser` since it was the default argument for the build script. This corrects it to `node` and `cjs` which I think should resolve node 20 issues.
poteto added a commit that referenced this pull request Jan 16, 2025
Alternative to #32071. As a follow up to #31993, the `platform` target
was incorrectly being set to `browser` since it was the default argument
for the build script. This corrects it to `node` and `cjs` which I think
should resolve node 20 issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants