Why does my React Vite app with Jointjs fail to load data in production?

138 Views Asked by At

React vitejs app using jointjs failed to load data on production mode.

I have created a reactjs vitejs app using jointjs which works fine in the development mode. Once I swtich it to production mode the app does not response. It says failed to laod data.

Github link https://github.com/KaziMinhaj/jedan-app

Console log error image

1

There are 1 best solutions below

1
James On

I just cloned your repo and ran it in production using npm run build and npm run preview, and everything is working fine for me. I don't have any errors in the console (Maybe, you have made some updates).

Just as a sidenote, in App.jsx, you can import the joint.css too. This will fix your grid, and a few other CSS related things.

import { useEffect, useRef } from 'react';
import * as joint from 'jointjs';
import 'jointjs/dist/joint.css';

enter image description here