next服务端渲染时跳过指定组件,由于某些组件使用了客户端的api,如果不跳过的服务端渲染话会报错,因为服务端没有这些api 在对应的pages中导入组件 由 import Components from '../components' 修改为 import dynamic from 'next/dynamic' const Components = dynamic(() => import('../components'