-
Notifications
You must be signed in to change notification settings - Fork 45
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
Project build fails with mui-tiptap v1.10.0: Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0) #264
Comments
This must be related to #259, attempting to fix #256. Seems supporting both node and NextJS environments may not be possible due to ESM incompatibilities of the underlying mui packages (see #258 (comment)). 😕 I can try to take a look later, and perhaps will just revert the recent change that forced the node env to use CJS, given NextJS's popularity. Perhaps the workaround on node could be to use |
Unfortunately I'm not much of an expert on those topics, so not much I can do in terms of suggestions I'm afraid. Happy to test something though if that can be of any help for you |
one solution is to use downgraded version. I am using mui-tiptap@1.8.0. which seems to work with NextJS |
@sourabhmandal I believe up until 1.9.5 should work on NextJS still, as the change I'm mentioning above was released in https://github.com/sjdemartini/mui-tiptap/releases/tag/v1.9.6. But I do plan to get NextJS compatibility working again. |
Mentioned this in a different thread but including here too: yesterday |
Still I am facing the issue in nextjs with typescript. Can you please let me know how to fix this error? I have tried to implement all-in-one component from the example. Version Details
|
@mohanlokesh pin the version to |
Got it! I was just wondering if there’s any update on a solution for the latest version. I’ve noticed that there have been about four releases since this issue was reported, and I'm also looking into MUI 6, which isn’t supported in the earlier versions. |
There isn't an update yet that resolves things for NextJS. I'm currently planning to revert the change the added support for Node environments that use ts-node/esm (resolving #256), in favor of bringing back NextJS support. Though I'd still ultimately like to support both, if possible—if anyone has suggestions to this end, please let me know. |
When `"type": "commonjs"` is specified in our package.json, it apparently causes the following problem in NextJS: ``` Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0) > export { default as ControlledBubbleMenu, } from "./ControlledBubbleMenu"; | export { default as LinkBubbleMenu, } from "./LinkBubbleMenu"; | export { default as MenuBar } from "./MenuBar"; ``` This is odd, since we indeed *are* using "commonjs" type, as that's the default, but it seems that fortunately merely omitting this resolves import errors in NextJS, and still supports NodeJS. Should resolve #264, removing one of the changes from #259, while still hopefully keeping #256 fixed.
@waza-ari @mohanlokesh I believe this should now be resolved in v1.12.0. Please give it a try and let me know if it works for you. |
@sjdemartini yes it worked, thank you so much 🎁🎁🥳🥳🎂 |
@sjdemartini if you have any chance can you please check this issue? 265 I am also having the same issue on editor with drawer function. Link, Color Picker, and table options are not showing above the drawer or model. |
Describe the bug
When building a NextJS project, the following error message appears since v1.10.0 (was working with v1.9.0, and pinning the version to v1.9.0 fixes the issue):
Expected behavior
I'm expecting to build my project after updating to v1.10.0
System (please complete the following information)
extensions
array used for the editor:The text was updated successfully, but these errors were encountered: