When I run the “build” command I get the error:
Error screenshot
Its coming from the ShadcnUi library. The components that I have imported are working just fine during development, but I get the above error during build time.
Github-repo: Demo
Dependencies:
"dependencies": {
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-toast": "^1.1.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"compressorjs": "^1.2.1",
"html-react-parser": "^5.1.10",
"lucide-react": "^0.379.0",
"nanoid": "^5.0.7",
"quill-resize-image": "^1.0.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-quill": "^2.0.0",
"react-router-dom": "^6.23.1",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7"
}
vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
// base: "/vizmo-assignment-blogs-creator/",
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
})
jsconfig.js
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
Importing of the components is done correctly, otherwise the app will crash even in development.
New contributor
Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.