Skip to content
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

[Compiler Bug]: Upgrading to react compiler runtime 19.0.0-beta-63e3235-20250105 breaks app built with Vite + React Route v7 #32011

Open
1 of 4 tasks
rishitells opened this issue Jan 7, 2025 · 3 comments
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug

Comments

@rishitells
Copy link

rishitells commented Jan 7, 2025

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://github.com/rishitells/react-router-v7-react-compiler

Repro steps

React compiler setup breaks after upgrading the compiler related dependencies to 19.0.0-beta-63e3235-20250105.

Stack trace:

 [vite] Error when evaluating SSR module /app/root.tsx: failed to import "react-compiler-runtime"
|- /Users/rishabhsharma/Projects/react-router-v7/node_modules/.pnpm/[email protected][email protected]/node_modules/react-compiler-runtime/dist/index.js:17
import * as React from "react";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (node:internal/modules/cjs/loader:1378:20)
    at Module._compile (node:internal/modules/cjs/loader:1428:41)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at cjsLoader (node:internal/modules/esm/translators:346:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at nodeImport (file:///Users/rishabhsharma/Projects/react-router-v7/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:53056:15)
    at ssrImport (file:///Users/rishabhsharma/Projects/react-router-v7/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52914:16)
    at eval (/Users/rishabhsharma/Projects/react-router-v7/app/root.tsx:5:31)
    at instantiateModule (file:///Users/rishabhsharma/Projects/react-router-v7/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52972:5)

How often does this bug happen?

Every time

What version of React are you using?

19.0.0

What version of React Compiler are you using?

19.0.0-beta-63e3235-20250105

@rishitells rishitells added Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug labels Jan 7, 2025
@rishitells
Copy link
Author

Seems like this is fixed in #31993?

@Sardorbek-Kuvondikov
Copy link

Create React app not loading fully in version 19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Optimizing Compiler Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants
@rishitells @Sardorbek-Kuvondikov and others