-
Notifications
You must be signed in to change notification settings - Fork 38
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
Initializing monaco as an npm package with Next.js #25
Comments
hey 👋 @omniphx This issue should be referred to the original repository - Be aware that if you use it as npm package you should also use monaco-editor-webpack-plugin |
Hello 👋 /** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: ["monaco-editor"],
};
module.exports = nextConfig; You must transpile the 'monaco-editor' module if you want to use it in Nextjs. |
Hey @KiLLg0r! It doesn't work the way you described it. I'm dealing with |
Hey @czescwojtek ! I'm sorry to hear that. I didn't had this specific error. |
oh, that's a bummer, I need the newer one. Thanks anyway! @KiLLg0r |
I have the same problem, the load monaco-editor from CDN is prolonged significantly in China |
Hey @KiLLg0r , I'm downgrading to version @0.31.1, But it doesn't work! I got |
any updates on this? i also got |
Hello @jeffreys-cat and @beadex. I have no update about it. The only way I managed to make it work was to downgrade @monaco-editor/react, which is not very worth and solves the problem only at the moment. If I will find a solution in which to work all l will come back with updates. |
@KiLLg0r to which version did you downgrade in order to get rid of this issue? Thanks in advance :) |
I too am getting |
Describe the bug
I'd like to initialize monaco from an npm package so I can write unit tests. Seems like this is a common problem since monaco is by default initialized remotely.
Unfortunately, it seems that inside a Next.js app I'm either implementing this incorrectly or it doesn't work:
I'm also importing this component with SSR turned off:
To Reproduce
Run this example: https://stackblitz.com/edit/nextjs-xye7xg?file=components/Code.tsx
Will see an console error :
Expected behavior
The text was updated successfully, but these errors were encountered: