tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.03k stars 1.27k forks source link

@heroicons/react/20/solid Attempted import error: 'createElement' is not exported from 'react' #1082

Closed UtilExe closed 8 months ago

UtilExe commented 8 months ago

On a Next.js 13 project, I am getting below error: ./node_modules/@heroicons/react/20/solid/esm/AcademicCapIcon.js Attempted import error: 'createElement' is not exported from 'react' (imported as 'React').

Triggered when I import below: import { CheckCircleIcon, XMarkIcon } from '@heroicons/react/20/solid'

thecrypticace commented 8 months ago

Hmmm, that's a pretty bizarre error. If createElement does not exist as an export then JSX will not work. In any case, I'm not seeing this in a freshly created Next.js 13 project. Can you provide a reproduction that we can clone on GitHub?

thecrypticace commented 8 months ago

Hey, gonna close this one since I don't have a way of reproducing this. If you can provide one though leave a comment with it and at-mention me and I'll take a look!

ninjasort commented 5 months ago

Hey I'm getting the same issue.

./node_modules/@heroicons/react/24/outline/esm/HomeIcon.js
Attempted import error: 'createElement' is not exported from 'react' (imported as 'React').

I'm using the latest 2.1.1.

You can check the error by building the main starter-example here: npx create-next-app@latest nextjs-dashboard --use-npm --example "https://github.com/vercel/next-learn/tree/main/dashboard/starter-example"

Go through this chapter: https://nextjs.org/learn/dashboard-app/navigating-between-pages