-
Notifications
You must be signed in to change notification settings - Fork 13
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
Uncaught TypeError: Object prototype may only be an Object or null: undefined #9
Comments
Monaco can't load the service workers from an external domain When the workers can't load it falls back to running language-server-protocol tasks (ie syntax highlighting) on the main thread and throws these errors. If you run the web component from the same domain where the files are hosted (ie not jsDelivr) the warnings should go away. That's why the demo for this project is hosted here instead of on WebComponents.dev |
Oh... That's not too friendly to webpack. I don't find a grace way to load it... |
You still need an index.html to load the bundle created by webpack. Import the web component from there instead. If you don't need it on the landing page you could add async|defer to the script tag to optimize loading. These web components aren't React components. They don't need to pass through a bundler to work. If you try to use them before they're defined no errors will be thrown. Undefined components are essentially empty divs. |
Yes as you can see I am manipulating raw dom to wrap it into a react component. The real problem here is I have to host a real folder for Monaco instead of let webpack handle it for me even I use real ES Module in browswr, I cant load it cross origin. |
My code:
The text was updated successfully, but these errors were encountered: