Edge labels not visible in nextjs production build
kanitsharma opened this issue · 5 comments
Describe the bug
Edge labels not visible in nextjs production build.
No errors in console.
It is present in component tree, checked in react devtools.
Working properly in development server.
Tested on chrome and firefox with reagraph@4.7.0
Steps to Reproduce the Bug or Issue
yarn create next-app reagraph-edgelabel-issue
yarn add reagraph
- Usage
import dynamic from "next/dynamic";
const GraphCanvas = dynamic(
import("reagraph").then((mod) => mod.GraphCanvas),
{ ssr: false }
);
export default function Test() {
return (
<GraphCanvas
labelType="all"
nodes={[
{
id: "n-1",
label: "1",
},
{
id: "n-2",
label: "2",
},
]}
edges={[
{
id: "1->2",
source: "n-1",
target: "n-2",
label: "Edge 1-2",
},
]}
/>
);
}
yarn build
andyarn start
Expected behavior
Edge labels should be visible.
Screenshots or Videos
No response
Platform
- Reagraph Version: 4.7.0
- OS: macOS
- Browser: Chrome, Firefox
- NodeJS version: 16.17.1
Your Example Website or App
No response
Additional context
No response
same
@infosechoudini / @kanitsharma - Any chance you could make me an example repo? I'm not super familiar with Next.
@amcdnl @infosechoudini It seems to be fixed in reagraph v4.11.1 and next v13.4.12. Its been a while but If I remember correctly this issue was specific to v4.7.0. In my case I reverted back to v4.5.0 and it was working fine, if that helps.
I observe this issue in a project built with Vite 4, React 18 and Reagraph 4.14.1, Setting reagraph to older versions has no effect. Does anyone know what might be the cause for this? I see that a newly created nextjs 14 project does work fine.
I created an example project to reproduce this issue: https://github.com/hechtjo/reagraph-test
Starting a local dev environment or producing a production build does not make a difference in this case.
Edit: It works now, for some reason labelType='all'
has to be specified in this case for the edge-labels to be shown.
NextJS should now not error.