Error during deployment of vite+react+tailwind website on netlify

82 views Asked by At

I have created a basic portfolio website using vite+react+tailwind and it worked properly in local but when i tried to deploy it it gives the following error:-

[13:56:48.443] Running build in Cleveland, USA (East) – cle1

[13:56:48.509] Cloning github.com/shekhar771/portfolio_ (Branch: master, Commit: 4106bad) [13:56:48.746] Previous build cache not available [13:56:49.333] Cloning completed: 823.179ms [13:56:49.670] Running "vercel build" [13:56:50.177] Vercel CLI 31.3.1 [13:56:50.725] Installing dependencies... [13:56:55.210] [13:56:55.210] added 294 packages in 4s [13:56:55.211] [13:56:55.211] 91 packages are looking for funding [13:56:55.211] run npm fund for details [13:56:55.231] Detected package-lock.json generated by npm 7+... [13:56:55.232] Running "npm run build" [13:56:55.527] [13:56:55.527] > [email protected] build [13:56:55.527] > vite build [13:56:55.527] [13:56:55.941] [36mvite v4.3.9 [32mbuilding for production...[36m[39m [13:56:55.971] transforming... [13:56:56.350] [32m✓[39m 22 modules transformed. [13:56:56.350] [32m✓ built in 408ms[39m [13:56:56.350] [31m[vite]: Rollup failed to resolve import "react-icons/Bs" from "/vercel/path0/src/components/Social.jsx". [13:56:56.351] This is most likely unintended because it can break your application at runtime. [13:56:56.351] If you do want to externalize this module explicitly add it to [13:56:56.351] build.rollupOptions.external[39m [13:56:56.357] [31merror during build: [13:56:56.357] Error: [vite]: Rollup failed to resolve import "react-icons/Bs" from "/vercel/path0/src/components/Social.jsx". [13:56:56.358] This is most likely unintended because it can break your application at runtime. [13:56:56.358] If you do want to externalize this module explicitly add it to [13:56:56.358] build.rollupOptions.external [13:56:56.358] at viteWarn (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:46597:23) [13:56:56.359] at onwarn (file:///vercel/path0/node_modules/@vitejs/plugin-react/dist/index.mjs:238:9) [13:56:56.359] at onRollupWarning (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:46618:9) [13:56:56.359] at onwarn (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:46368:13) [13:56:56.359] at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24051:13 [13:56:56.359] at Object.logger [as onLog] (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:25718:9) [13:56:56.359] at ModuleLoader.handleInvalidResolvedId (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24634:26) [13:56:56.359] at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:24594:26 [13:56:56.359] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)[39m [13:56:56.381] Error: Command "npm run build" exited with 1

I have created a basic portfolio website using vite+react+tailwind to solve this i add rollup option it gives blank page in netlify

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  build: {
    rollupOptions: {
      external: [
        'react-icons/Bs',
        'react-icons/cg',
        'react-icons/Fa',
        'react-icons/si',
      ], // Add this line
    },
  },
});
here
0

There are 0 answers