-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unable to run using Next.js #44
Comments
Editor Not working, UseThe problem which you demonstrated is not actually with firepad, but monaco-editor. https://www.npmjs.com/package/@monaco-editor/react Above will get your editor running. But There is problem in current implementation of firepad and it still wont support NextJs. Right now firepad implementation has monaco-editor as a peer dependency, which is problematic to use with NextJs, (issue which you faced rn). Currently firepad uses monaco instance by directly importing global monaco-editor as dependency, To make it work we need to be able to pass monaco instance to fromMonaco method circumvent this problem, which will require a big rewrite. @Progyan1997 can tell whether if that will be a viable option. There might be another solution with webpack, Things to keep in mind that Next 11 has now moved to webpack 5 but Next10 is and older still remain very popular till date. I am not a webpack expert to be able to figure that out. I too faced same issue, I had to move quickly with the project, so I choose to create a Reactjs project and import it using just used an iframe to render it inside my NextJs project, with interframe communication. Its almost imperceptible except for some unwanted reloads when I change language. Here is the React implementation which I use inside iframe. https://cpd.skillcounty.com?lang=python |
Hi @zenorocha, as @Shubham567 already mentioned you need to a bit of hardlifting to get |
I was able to run Firepad successfully using plain React, but unfortunately, I couldn't execute it using Next.js
Here's a running example without Firepad:
https://codesandbox.io/s/react-moncao-editor-nextjs-without-firepad-u8p4k
And here's what happens when you import the package:
https://codesandbox.io/s/react-moncao-editor-nextjs-with-firepad-4ny9s
It would be amazing if we could get this fixed.
The text was updated successfully, but these errors were encountered: