Skip to content
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

"Unexpected usage"-error when importing from CDN #15

Closed
gismya opened this issue Mar 2, 2021 · 1 comment
Closed

"Unexpected usage"-error when importing from CDN #15

gismya opened this issue Mar 2, 2021 · 1 comment

Comments

@gismya
Copy link

gismya commented Mar 2, 2021

When importing from CDN and trying to use the language features, whether by adding a language attribute to the component or programmatically, you get the error message "Unexpected usage" on every keystroke.

Fiddle

@evanplaice
Copy link
Member

If you read the console errors. It's failing to load the worker (ie. Language-Server-Protocol module) directly from the CDN

If you look at the demo linked in README.md where it's not loading from a CDN, it works perfectly. This is a problem specific to JSDelivr, not wc-monaco-editor.

I don't think there's a way to fix this component to work directly from a CDN unless the CDN itself natively supports ES modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants