tailwindlabs / heroicons

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

Nextjs build error after update v1.0.6 to v2.0.11 #830

Closed rhmtrz closed 1 year ago

rhmtrz commented 1 year ago

Hello everybody

I updated the @heroicons/react to v2.

I also changed the importing path import { ArrowLeftIcon } from '@heroicons/react/24/solid'

But when I am running npm run build to build it, It shows the below error

Error occurred prerendering page "/admin-authenticated/user-warpner-link". Read more: https://nextjs.org/docs/messages/prerender-error
Error: You're trying to import `@heroicons/react/outline/FilmIcon` from Heroicons v1 but have installed Heroicons v2. Install `@heroicons/react@v1` to resolve this error.
    at Object.get ( ../..node_modules/@heroicons/react/outline/index.js:9:13)
    at AdminTopbarAndSidebarLayout (../.next/server/chunks/4695.js:58:73)
adamwathan commented 1 year ago

Sounds like you still have some imports that haven’t been updated, that’s the only time we display that warning. If for whatever reason that’s not the issue, please open a new issue but include a reproduction so we can take a look at the code 👍🏻