Skip to content

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

Open

Description

@baoanh177

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

Activity

  1. Patrick7241 commented on Dec 17, 2024

    @Patrick7241

    it's confused me,too

  2. prakashk-mallow commented on Dec 18, 2024

    @prakashk-mallow

    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
  3. Patrick7241 commented on Dec 18, 2024

    @Patrick7241

    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.

  4. prakashk-mallow commented on Dec 18, 2024

    @prakashk-mallow

    @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

  5. Patrick7241 commented on Dec 18, 2024

    @Patrick7241

    image

    next 14.2.20 antd 5.22.5

  6. prakashk-mallow commented on Dec 18, 2024

    @prakashk-mallow

    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

  7. baoanh177 commented on Dec 18, 2024

    @baoanh177
    Author

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

  8. Patrick7241 commented on Dec 19, 2024

    @Patrick7241

    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.

  9. prakashk-mallow commented on Dec 19, 2024

    @prakashk-mallow
    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
  10. Patrick7241 commented on Dec 19, 2024

    @Patrick7241

    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".

  11. prakashk-mallow commented on Dec 19, 2024

    @prakashk-mallow

    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

  12. baoanh177 commented on Dec 19, 2024

    @baoanh177
    Author

    @prakashmallow That's page router

  13. prakashk-mallow commented on Dec 19, 2024

    @prakashk-mallow

    @baoanh177 Yes. I'm using page router

  14. prakashks20 commented on Dec 19, 2024

    @prakashks20

    @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

  15. prakashk-mallow commented on Dec 20, 2024

    @prakashk-mallow

    @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

  16. lovewinders commented on Dec 23, 2024

    @lovewinders

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

  17. prakashk-mallow commented on Dec 23, 2024

    @prakashk-mallow

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions