☝️Small business or a startup? See if you qualify for our special offer.
+

Error in Next.js 15 page router

Answered
Sajjad Ramezani asked on June 16, 2025

Hello, 

I installed this package with the following dependencies.

{

    "@amcharts/amcharts4": "^4.10.36",

    "@amcharts/amcharts5": "^5.3.15",

    "@types/node": "20.2.5",

    "@types/react": "^19.0.0",

    "@types/react-dom": "^19.0.0",

    "flexmonster": "latest",

    "highcharts": "^11.1.0",

    "react": "^19.0.0",

    "react-dom": "^19.0.0",

    "next": "15.1.3",

    "open-cli": "^7.2.0",

    "react-flexmonster": "latest",

    "typescript": "5.1.3"

}

 

But this package does not run in Next.js 15 page router.

and displays the following error:

"Error: A React Element from an older version of React was rendered. This is not supported. It can happen if:

- Multiple copies of the "react" package is used.

- A library pre-bundled an old copy of "react" or "react/jsx-runtime".

- A compiler tries to "inline" JSX instead of using the runtime."

 

Although it runs without problems in Next.js 15 app router.

2 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster June 17, 2025

Hello Sajjad,

Thank you for contacting us.

Our team will research possible solutions and provide you with the results ETA July 7th.

As a temporary workaround, you can downgrade React to version 18:

"react": "^18.0.0",
"react-dom": "^18.0.0",

Also, we suggest considering using the app router instead of the page router since it is recommended for Next.js projects.

You are welcome to contact us if other questions arise.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 2 days ago

Hello Sajjad,

We are happy to inform you that now react-flexmonster is compatible with React 19.

This fix is available in the 2.9.107 version of Flexmonster: https://www.flexmonster.com/release-notes/version-2-9-107/

You are welcome to update the wrapper. Check out our updating tutorial for guidance: https://www.flexmonster.com/doc/updating-to-the-latest-version/#updating-wrappers.

Please let us know if the fix works.

Best regards,
Nadia

Please login or Register to Submit Answer