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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEEDBACK] Issue using with @monaco-editor/react
in NextJS
#9
Comments
Can you try again in v0.3.1 when passing in your own Edit: Please try with v0.3.2, there was an issue with 0.3.1. |
Tried 0.3.2, for some reason it still doesn't work. I've been trying to find the cause for this for a few hours now... And yes, I'm passing the EDIT: |
Okey, got it. Was looking in the wrong places all along... Dynamic imports won't work, as those are still compiled (just might not get used in runtime) and the global css check happens at compile time. |
Got it working with the hack of using next-remove-imports for now, would prefer an out-of-box solution rather than hacks, though :/ |
Huh, interesting, would not have thought that. I'll look into alternatives for that in the coming week. Out of curiosity, how do you import monaco on your side to be passed through to this package such that the css files are not imported? |
I use |
Having same issue here. ref: https://github.com/suren-atoyan/monaco-react/blob/master/package.json |
Also pinging this new issue, will open a new issue once confirmed. After hacking with @burtek 's solution, i got it to compile & run, but then i get this message. (using same next12 configuration)
|
True, but that won't solve this issue.
@softmarshmallow happy to help if you share your Next config file ;) |
Here is my repo. but i dropped the changes yesterday and decided to wait until this issue is solved. Thanks anyway! |
Hi. here's the commit that captures the issue You may see the latest commit |
This seems to be a I had a same issue when exported a logic to a different file (addCommand) and the same issue occurred. |
I now moved monaco-editor to the peerDependencies, and added a new entrypoint. You can try to import from |
Works great now! Thanks you very much! :) |
For those who do now want to read all the comments of this issue. SolutionImport from Beforeimport { AutoTypings, LocalStorageCache } from "monaco-editor-auto-typings"; Afterimport { AutoTypings, LocalStorageCache } from "monaco-editor-auto-typings/custom-editor"; |
Not sure if bug or feature request... 馃
Right now I'm unable to use
monaco-editor-auto-typings
with@monaco-editor/react
because it makes some global CSS get imported fromnode_modules
which is what NextJS doesn't like.More precisely,
monaco-editor-auto-typings
importsmonaco-editor
inAutoTypings.ts
which in turn indirectly imports global css inmonaco-editor\esm\vs\base\browser\ui\actionbar\actionViewItems.js
.The solution would be to not import
monaco-editor
but that would break the fallback. Another solution would be to have another export (i.e.monaco-editor-auto-typings/nextjs
) that doesn't auto-importmonaco-editor
but requiresmonaco
instance to be passed in options.Is there any chance to get
monaco-editor-auto-typings
working with NextJS ?The text was updated successfully, but these errors were encountered: