【发布时间】:2021-11-20 17:21:11
【问题描述】:
我正在尝试导入 Swiper 以响应我的应用程序并在 Storybook 中使用它。
我有以下导入:
import { Swiper, SwiperSlide } from 'swiper/react';
这在 React 应用程序中有效,但在 Storybook 中无效,我收到以下错误:
ModuleNotFoundError: Module not found: Error: Can't resolve 'swiper/react'
其他 React 模块可以毫无问题地导入。我需要更改 Storybook 中的某些配置吗?
【问题讨论】:
-
我们能解决这个问题吗?我有同样的问题,storybook 似乎认为
swiper/react是模块,而swiper是模块,react是模块内的文件夹 -
我猜你必须使用 Swiper V6
标签: reactjs next.js storybook swiperjs