-
Notifications
You must be signed in to change notification settings - Fork 155
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
Angular 14 #259
Comments
can you please let me know the url of the forked version?Thanks |
@here I've a new fork with latest angular 14, ngZone upgrade and fixed production missing assets, have a look, works for my company now: |
Thanks this seems to work mostly, Alternative question, maybe you know... Why is formcontrol missing for As I found here this is needed: angular/angular#43821 |
@miki995, hi!
Upd: colors was missing in my custom theme |
Will check in couple of days, I'm busy these days, sorry... |
Hi, sorry, the problem is solved. It was due to missing colors property. Thank you! |
@miki995 http://localhost:4200/assets/monaco/min/vs/loader.js net::ERR_ABORTED 404 (Not Found) |
@rjf26 You have to add monaco-editor to your package.json, as now it is not shipped with ngx-monaco-editor anymore |
I had to add the loader in my assets from monaco-editor:
|
Link the new version and adapt our setup to match the changed API: + Fix error 'Cannot read properties of undefined (reading 'editor.foreground')' described at microsoft/monaco-editor#2764 and atularen/ngx-monaco-editor#259 : Apply the patch from microsoft/monaco-editor@88fd0a6 + Fix error 'Uncaught Error: a.onDidChangeValue is not a function': Apply the patch https://stackoverflow.com/questions/54795603/always-show-the-show-more-section-in-monaco-editor/73287722#73287722
@miki995 could you link to your github repo and update the repository/homepage links for your fork on NPM? |
@allout58 Hello, I thought links were fixed, but I believe I only fixed them on github page, will update now |
I have tried your version of ngx-monaco-editor but I get errors regarding css imports (Angular 14.1.0, ngx-monaco-editor-v2 14.0.4 and monaco-editor 0.34.1). Any idea what might be wrong?: ./node_modules/monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css:6:0 - Error: Module parse failed: Unexpected token (6:0)
|
@nhack Hello, can you provide simple example or not? |
@miki995 I figured out what was wrong. I had the following import in my code: |
Had the same issue, here's what helped me:
|
Thanks for your comments here, and I am trying to solve the same issue, but I am not very experienced with typescript. @Klaster1 would you be willing to expand on your solution here? |
The issue happens because "monaco-editor" (or ngx-monaco-editor?) has its own loader for CSS, but you import "monaco-editor" into the app, trigerring the asset load, which you might not have a webpack loader. One of solutions is not to perform runtime imports from "monaco-editor". You can still import types from "monaco-editor", for example |
Hi, same issue here, and don't know how to use the Window interface you mentioned to interact with the library. Would you be so kind as to provide with some short example? |
Thanks for the pointers @Klaster1! It took me a little bit to figure out the Window interface trick, so let me document how I got it to work. // See https://stackoverflow.com/questions/12709074/how-do-you-explicitly-set-a-new-property-on-window-in-typescript
declare global {
interface Window {
monaco: typeof import("monaco-editor");
}
}
// ...
setDiagnosticOptions() {
window.monaco.languages.json.jsonDefaults.setDiagnosticOptions({
//...
});
} |
Guess this package is no longer maintained - I'll probably fork it and migrate it to Angular 14 soon, in the meantime as it still works in 14 other than the dep issue on npm install you can override it with this in the
package.json
."overrides": { "ngx-monaco-editor": { "@angular/common": "$@angular/common", "@angular/core": "$@angular/core" } }
The text was updated successfully, but these errors were encountered: