import React from 'react';
import logo from './logo.svg';
import './App.css';
import { Graphviz } from "graphviz-react";
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo"/>
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
<Graphviz dot={`graph {
grandparent -- "parent A";
child;
"parent B" -- child;
grandparent -- "parent B";
}`}/>
</header>
</div>
);
}
export default App;
Output of npm run build:
npm run build
> graphviz-test@0.1.0 build
> react-scripts build
Creating an optimized production build...
Failed to compile.
Module not found: Error: Can't resolve 'graphviz-react' in 'path-to-project/graphviz-test/src'
Is the issue caused by using React 18? I wonder if it might work if I was using an older version of create-react-app. I'm currently using create-react-app version 5.0.1.
I am unable to set up a create-react-app project using graphviz-react 1.2.3.
Steps to reproduce:
npx create-react-app graphviz-test --template typescript
cd graphviz-test
npm install graphviz-react
Output of
npm run build
:This gives a package.json of:
Is the issue caused by using React 18? I wonder if it might work if I was using an older version of create-react-app. I'm currently using create-react-app version 5.0.1.