-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import failed from react component #217
Comments
I added some examples that work with React in https://mauriciopoppe.github.io/function-plot/, I didn't test this with next.js though |
@mauriciopoppe |
Thanks for the pointer, I pushed a fix in #222, you could try pulling the latest commit from master to test it |
Was it determined whether this fixed the issue? I came across the same error when using NextJS, as in the error message above it references the import of d3_shape rather than the polyfills import but I'm struggling to be able to confirm whether the most recent change made a difference. I tried getting the latest version by forking and then installing directly from github but npm threw a billion errors so quite possibly was down to me doing something wrong |
There's a minimally reproducible example of using function-plot with NextJS in #278 (comment) so I think it should be working now with the latest 2.0.0 alpha build. |
I added function-plot as in docs to react component in next.js project as below
`import functionPlot from 'function-plot'
function Form() {
const [realRoot, setRealRoot] = useState(0);
const [imRoot, setImRoot] = useState(0);
const [showResult, setShowResult] = useState(false);
functionPlot({
target: '#plot',
data: [{
fn: 'x^2'
}]
})`
I got the following error,
![image](https://user-images.githubusercontent.com/43521606/202133126-16f7119c-63a0-46c3-9ef5-cc625874a2b3.png)
What is the cause, I would be glad to add PR for solving it if needed, thanks
The text was updated successfully, but these errors were encountered: