Error at deploy a react project on vercel

Viewed 40

I am receiving an error when i try to deploy using vercel, i created the app with vite

this is what i get:

vite v3.0.2 building for production...
transforming...
✓ 42 modules transformed.
[vite]: Rollup failed to resolve import "swiper/react" from "src/components/Slider.jsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "swiper/react" from "src/components/Slider.jsx".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at onRollupWarning (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-1513d487.js:43558:19)
    at onwarn (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-1513d487.js:43349:13)
    at Object.onwarn (file:///vercel/path0/node_modules/rollup/dist/es/shared/rollup.js:23177:13)
    at ModuleLoader.handleResolveId (file:///vercel/path0/node_modules/rollup/dist/es/shared/rollup.js:22334:26)
    at file:///vercel/path0/node_modules/rollup/dist/es/shared/rollup.js:22295:26
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Command "npm run build" exited with 1```

Any suggestion on how to solve it?
0 Answers
Related