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

Error in Next.js 15 page router

Answered
Sajjad Ramezani asked 1 day ago

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.

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 6 hours ago

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

Please login or Register to Submit Answer