fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.33k stars 676 forks source link

Attempted import error: 'isValidElement' is not exported from 'react' (imported as 't'). #1073

Closed Katanis closed 3 months ago

Katanis commented 4 months ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? Receiving error: ./node_modules/react-toastify/dist/react-toastify.esm.mjs Attempted import error: 'isValidElement' is not exported from 'react' (imported as 't').

Import trace for requested module: ./node_modules/react-toastify/dist/react-toastify.esm.mjs

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below: When trying to npm run dev I receive this error and the app is crashed. This is my dependencies: "react": "18.2.0", "react-toastify": "10.0.4",

What is the expected behavior? To work normally Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? "next": "14.1.0", "react": "18.2.0", it worked with react version 17 and next.js v 12, I am upgrading my project dependencies.

Katanis commented 4 months ago

It does not work with app router but works with page router.

Linux249 commented 3 months ago

Fixed this for me with downgrading to 8.2.0

Katanis commented 3 months ago

Updated browserslist object in package.json I had to update the development array and include Chrome:

"development": [
      "Chrome 118",
      "last 1 chrome version",
      "last 1 edge version",
      "last 1 firefox version",
      "last 1 safari version"
    ]