小编Rit*_*rya的帖子

您正在尝试从 Heroicons v1 导入“@heroicons/react/outline/SearchIcon”,但已安装 Heroicons v2。安装`@heroicons/react@v1`

我一直在尝试使用heroicons并继续面临错误我尝试安装'@heroicons/react@v1',我也尝试从“@heroicons/react/outline”和“@heroicons/react/24/outline”导入,有时它可以在手机上使用,如果我刷新它甚至在手机上也不再可用。我尝试单独使用命令提示符,但也没有多大帮助。它一直说:

服务器错误 错误:您正在尝试从 Heroicons v1 导入@heroicons/react/outline/SearchIcon,但已安装 Heroicons v2。安装@heroicons/react@v1以解决此错误。

生成页面时发生此错误。任何控制台日志都将显示在终端窗口中。源组件\Header.js (35:25) @ Header

import React from 'react'
import Image from 'next/image'
import {
    SearchIcon,
    PlusCircleIcon,
    UserGroupIcon,
    HeartIcon,
    PaperAirplaneIcon,
    MenuIcon
} from "@heroicons/react/outline";
import {HomeIcon} from "@heroicons/react/solid"

function Header() {
  return (
    <div className='shadow-sm border-b bg-white sticky top-0 z-50'>
        <div className='flex justify-between max-w-6xl mx-5 lg:mx-auto'>
            {/* Left */}
            <div className="relative hidden lg:inline-grid h-24 w-24 cursor-pointer">
                <Image src="https://links.papareact.com/ocw" 
                layout="fill" 
                objectFit='contain'
                />
            </div>
            <div className="relative w-10 lg:hidden flex-shrink-0 cursor-pointer">
                <Image …
Run Code Online (Sandbox Code Playgroud)

reactjs next.js heroicons

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

heroicons ×1

next.js ×1

reactjs ×1