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

reactRender is not a function when using Antd with NextJS App Router #606

Open
baoanh177 opened this issue Dec 15, 2024 · 17 comments
Open

Comments

@baoanh177
Copy link

I'm initializing a NextJS AppRouter project with Antd. I've been looking for a solution but can't find it, can anyone help me, pls.

  • Here are project dependencies:
    image

  • src/app/layout.tsx
    image

  • src/app/page.tsx
    image

It works until I click the button, console.log() ran but with errors
image

@whatdfjslfjldks
Copy link

it's confused me,too

@prakashmallow
Copy link

prakashmallow commented Dec 18, 2024

I am also facing the same issue, but I downgraded the Next.js version to 14.2.20 to investigate further. The exact issue is detailed below.

Screenshot 2024-12-18 at 1 31 44 PM Screenshot 2024-12-18 at 1 32 18 PM Screenshot 2024-12-18 at 1 39 04 PM

@whatdfjslfjldks
Copy link

I have downgraded the version of Next to 14 to resolve the reactRender issue, and I will change the version back after the official fix. I have not encountered the "unexpected token" problem you mentioned, and my current use of Ant Design components is normal.

@prakashmallow
Copy link

prakashmallow commented Dec 18, 2024

@whatdfjslfjldks Which versions of Next.js and Ant Design (antd) are being used in your project?
I'm still facing the above issue on both next package 14(14.2.18 to 14.2.20) and 15 versions

@whatdfjslfjldks
Copy link

image

next 14.2.20 antd 5.22.5

@prakashmallow
Copy link

prakashmallow commented Dec 18, 2024

image

next 14.2.20 antd 5.22.5

@whatdfjslfjldks I'm using the same next dev, which is working fine but next build throws the above error

@baoanh177
Copy link
Author

I tried downgrade NextJS version to 14.2.20 and the problem was resolved, but with version 15.1.0 it was not

@whatdfjslfjldks
Copy link

image
next 14.2.20 antd 5.22.5

@whatdfjslfjldks I'm using the same next dev, which is working fine but next build throws the above error

image
I have tried next build, for me is ok.

@prakashmallow
Copy link

Screenshot 2024-12-19 at 7 39 18 AM Screenshot 2024-12-19 at 7 37 00 AM I have downgraded to 14.2.20 and `next dev` the above error is occurring

@whatdfjslfjldks
Copy link

I'm not sure what caused this, maybe you can try updating the TypeScript version cuz the tip "dependency "typescript@>=4.8.4 <5.8.0".

@prakashmallow
Copy link

I'm created new project with typescript the same error is throws when run both next dev and next build.
Screenshot 2024-12-19 at 7 53 32 AM
Screenshot 2024-12-19 at 7 57 31 AM
Screenshot 2024-12-19 at 7 58 04 AM
Screenshot 2024-12-19 at 7 58 44 AM

@baoanh177
Copy link
Author

@prakashmallow That's page router

@prakashmallow
Copy link

@baoanh177 Yes. I'm using page router

@prakashks20
Copy link

prakashks20 commented Dec 19, 2024

@baoanh177 We are facing issues when running the next dev and next build commands after installing and configuring the antd package in Next.js projects. This issue occurs in both App Router (JSX) and Page Router (using both JSX and TSX) projects when importing antd components.

next 14.2.20
antd 5.22.5

@prakashmallow
Copy link

prakashmallow commented Dec 20, 2024

@baoanh177 We are facing issues when running the next dev and next build commands after installing and configuring the antd package in Next.js projects. This issue occurs in both App Router (JSX) and Page Router (using both JSX and TSX) projects when importing antd components.

next 14.2.20 antd 5.22.5

@zombieJ @afc163 I'm currently facing the below issue with the next 14.2.20(pages router with JSX), and antd 5.22.5 or lower versions
Screenshot 2024-12-20 at 3 43 29 PM

@lovewinders
Copy link

lovewinders commented Dec 23, 2024

the same problem, for example:#550, react 19 version

@prakashmallow
Copy link

@baoanh177 We are facing issues when running the next dev and next build commands after installing and configuring the antd package in Next.js projects. This issue occurs in both App Router (JSX) and Page Router (using both JSX and TSX) projects when importing antd components.
next 14.2.20 antd 5.22.5

I'm currently facing the below issue with the next 14.2.20(pages router with JSX), and antd 5.22.5 or lower versions Screenshot 2024-12-20 at 3 43 29 PM
@afc163 @zombieJ Please check this issue while creating a new nextjs project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants