Closed Aayush04 closed 2 years ago
hey @Aayush04 we haven't faced issues with v1.2.0
, but as there is a new version, may I ask you to check the latest version? (v1.3.0
). Feel free to re-open it if there is an issue
@suren-atoyan Facing same issue with v1.3.0 also.
@suren-atoyan This is working when I changed my file extension to .ts
. But don't know why it is not working with .js
file.
This is how my file look like:
monaco-editor-loader.js
import loader, { Monaco } from "@monaco-editor/loader";
const DEFAULT_PATH = "https://unpkg.com/monaco-editor@0.32.0/min/vs";
export function init(url): Promise<Monaco> {
if (!url) {
url = DEFAULT_PATH;
}
loader.config({
paths: {
vs: url
},
})
return loader.init();
}
But the same code was working with v1.1.1.
@Aayush04 I can't reproduce your issue.
Here is a code snippet - with .js
file and with the latest (1.3.0
) and it seems to be working.
Could you please create a snippet that shows your issue?
your issue is related to typescript. I guess it's about this line:
export function init(url): Promise<Monaco>
loader.init()
doesn't return Promise<Monaco>
it returns CancelablePromise<Monaco>
. Check this
In version 1.2.0 we fixed exactly that 🙂
Getting following compiler error
when importing as:
using following configs