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

[TextField] Server Component bundler error #138

Closed
aq1 opened this issue Nov 5, 2023 · 7 comments
Closed

[TextField] Server Component bundler error #138

aq1 opened this issue Nov 5, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation ecosystem Incompatibility with something else

Comments

@aq1
Copy link

aq1 commented Nov 5, 2023

Just started a new project. I wonder if Text Field is not meant to be used in server components?

Error: Could not find the module "/node_modules/.pnpm/@radix-ui+themes@2.0.0_@types+react-dom@18.2.14_@types+react@18.2.33_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/themes/dist/esm/components/text-field.js#TextField#Input" in the React Client Manifest. This is probably a bug in the React Server Components bundler.

import { TextField } from "@radix-ui/themes"
export const default Page() {
  return <div><TextField.Input placeholder="Enter your email" /></div>
}

package.json

    "next": "^14.0.1",
    "@radix-ui/react-icons": "^1.3.0",
    "@radix-ui/themes": "^2.0.0",
@vladmoroz
Copy link
Contributor

Next.js should be able to interleave client and server components, but they currently don't work well with the dot notation (See vercel/next.js#51593).

Can you try importing the parts as TextFieldRoot, TextFieldInput, etc?

@A1X5H04
Copy link

A1X5H04 commented Nov 13, 2023

Use 'use client' directive at top of your file.

@vladmoroz
Copy link
Contributor

Use 'use client' directive at top of your file.

You don't need this with Radix Themes components, they already have "use client" where relevant

@notDemian
Copy link

Use 'use client' directive at top of your file.

You don't need this with Radix Themes components, they already have "use client" where relevant

Having the same issue, using "use client" directive solved it

@vladmoroz
Copy link
Contributor

@notDemian have you tried importing the parts without the dot access? E.g. TextFieldRoot, TextFieldInput, rather than TextField.Root, TextField.Input?

@aq1
Copy link
Author

aq1 commented Nov 17, 2023

@vladmoroz It worked, thank you. You can close the issue if you need.

@vladmoroz vladmoroz added ecosystem Incompatibility with something else documentation Improvements or additions to documentation labels Jan 4, 2024
@MaximoSerafini
Copy link

Buenas, tengo el mismo problema, ya intente sin el punto y con el "use client" y ninguno me funciono

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ecosystem Incompatibility with something else
Projects
None yet
Development

No branches or pull requests

5 participants