contentful / extensions

Repository providing samples using the UI Extensions SDK
ISC License
203 stars 211 forks source link

window.contentfulExtension.init not firing #79

Closed Folashade closed 5 years ago

Folashade commented 5 years ago

I'm trying to run the bacon-ipsum sample and it works when plugged into the CF UI, but is not running locally. The window.contentfulExtension.init function doesnt seem to be firing and is not giving any error messages.

I've already set up the Contentful CLI and added my Access Token. I also tried wrapping it in a document.ready since the sample uses jquery, but that is also not working. Is this functionality still working for you guys?

stefanjudis commented 5 years ago

@Folashade and I discussed this and the problem is a misunderstanding. Contentful UI-extensions can only run inside of the web app itself. The callbacks won't fire when you're open the file without the surroundings of the webapp.

For local development you can adjust the extension.json to point to a URL like localhost:1234 via the src property. For production you can then point to a document to upload of even any URL out there using srcdoc.

vrunda-thacker commented 3 years ago

I am facing this issue on my local extension set up. Followed the documentation to create an extension... but nothing gets rendered in the root div and init function is not triggered. Has anybody been able to solve this?