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

Dependency warn: [vite] Failed to resolve dependency: react-compiler-runtime, present in client 'optimizeDeps.include' #12896

Open
1 task
JYbill opened this issue Jan 5, 2025 · 3 comments · May be fixed by #12923
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: react Related to React (scope)

Comments

@JYbill
Copy link

JYbill commented Jan 5, 2025

Astro Info

Astro                    v5.1.2
Node                     v22.8.0
System                   macOS (arm64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/react
                         @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

null

Describe the Bug

the following warning appears when starting with dev/build

[WARN] [vite] Failed to resolve dependency: react-compiler-runtime, present in client 'optimizeDeps.include'
  • i see @astro/react pkg, source code
function getViteConfiguration({ include, exclude, babel, experimentalReactChildren } = {}, reactConfig) {
  return {
    optimizeDeps: {
      include: [
        reactConfig.client,
        "react",
        "react/jsx-runtime",
        "react/jsx-dev-runtime",
        "react-dom",
        "react-compiler-runtime" // ⬅️ this, but not exist in package.json
      ],
      exclude: [reactConfig.server]
    },
    plugins: [react({ include, exclude, babel }), optionsPlugin(!!experimentalReactChildren)],
    resolve: {
      dedupe: ["react", "react-dom", "react-dom/server"]
    },
    ssr: {
      external: reactConfig.externals,
      noExternal: [
        // These are all needed to get mui to work.
        "@mui/material",
        "@mui/base",
        "@babel/runtime",
        "use-immer",
        "@material-tailwind/react"
      ]
    }
  };
}

I'm not sure if that's the problem

What's the expected result?

There should be no warning

Link to Minimal Reproducible Example

null

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 5, 2025
@JYbill
Copy link
Author

JYbill commented Jan 5, 2025

  • add image
image image

@deepanshu88
Copy link

+1 Facing same issue

@ascorbic ascorbic added pkg: react Related to React (scope) - P2: nice to have Not breaking anything but nice to have (priority) and removed needs triage Issue needs to be triaged labels Jan 6, 2025
@Xeuz27
Copy link

Xeuz27 commented Jan 8, 2025

sorry i have the same issue here, but i dont get if you added support in another version of astro, or if we have to do something manually, or if it is marked to being solved later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: react Related to React (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants