Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

ViteJS React app won't show components in Vite build but will appear when running development server from npm start

$
0
0

I have a react app that I made in ViteJS using JSX for its initial class and other components as well. When running npm start, the app works fine as it should. but when I try to build it using vite, nothing appears at first and I actually have to change the file paths from "/" to "./" in the html file, but after doing that all I get is the initial component that wraps the browser router and switcher. It doesn't handle any of the Links or components I added or even show the images I imported.

Development (What it should look like)enter image description here

Final build

enter image description here

I am not sure why my components are gone after building. I've tried using webpack and babel as an alternative to try and build it a different way but the problem is still the same.

Vite Configenter image description here

Main.jsx

enter image description here


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>