# \[New Feature\] Plugin preview rendering

**URL:** <https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489>\
**Category:** Announcements\
**Created:** [May 23, 2019, 4:34pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489 "2019-05-23T16:34:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [May 23, 2019, 4:34pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/1 "2019-05-23T16:34:18Z")

</div>

We’ve just released a new feature that allows plugins to be rendered in the editor. Up to now, user-written plugins have been represented by a static placeholder image in the editor, but going forward they will be able to work in the editor just as native Bubble elements do.

To take advantage of this new functionality, plugin developers should write a “preview” function in the elements tab of the plugin editor. The preview function is essentially a rehashing of the “initialize” or “update” function, simplified so as to be compatible with the more minimalist context of the editor. Two parameters are provided, _instance_ and _properties_, exposing the canvas, setHeight function (responsive mode only), element dimensions, and any properties the user has supplied. In most cases, you should be able to reuse your runmode code with a few alterations.

 ![50%20PM](https://us1.discourse-cdn.com/bubble/original/3X/8/d/8d26c61294aaaa5e82e76a79e2b5c09d4f898110.png)

Your plugin will then render itself in the editor, sizing itself correctly. Placeholder images will still be displayed for existing plugins until a preview function is specified.

 ![25%20PM](https://us1.discourse-cdn.com/bubble/original/3X/6/5/6560acab6e93a70f17afcd371ff9e4ea611806c8.png)

As always, your feedback/bug reports/feature requests/thoughts are welcome, and thank you for developing plugins for our platform!

---

<div class="post-metadata">

**Author:** ![JonL](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.bubble.io/u/JonL)\
**Post date:** [May 23, 2019, 4:44pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/2 "2019-05-23T16:44:34Z")

</div>

I am off to try this right now 🙂

---

<div class="post-metadata">

**Author:** ![jamesbond](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jamesbond/32/40242_2.png) [@jamesbond](https://forum.bubble.io/u/jamesbond)\
**Post date:** [May 23, 2019, 4:45pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/3 "2019-05-23T16:45:01Z")

</div>

Omg this is big

---

<div class="post-metadata">

**Author:** ![marcusandrews](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marcusandrews/32/246197_2.png) [@marcusandrews](https://forum.bubble.io/u/marcusandrews)\
**Post date:** [May 23, 2019, 4:49pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/4 "2019-05-23T16:49:25Z")

</div>

This is great! Nice job.

---

<div class="post-metadata">

**Author:** ![JonL](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.bubble.io/u/JonL)\
**Post date:** [May 23, 2019, 4:50pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/5 "2019-05-23T16:50:46Z")

</div>

@marca

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/6/f/6fa7b084c77909de50f2e7d1f7fa84047271a665.png)

---

<div class="post-metadata">

**Author:** ![steven.junio91](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@steven.junio91](https://forum.bubble.io/u/steven.junio91)\
**Post date:** [May 23, 2019, 4:50pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/6 "2019-05-23T16:50:55Z")

</div>

@marca  
Awesome I was wondering what this preview field was yesterday.

I ran into an issue with this though.

This is my bubble editor error for the plugin

 ![24%20AM](https://us1.discourse-cdn.com/bubble/original/3X/f/d/fdd46bbbb5efc7ceeab4010d8cea4a1a2a2c9f1e.png)

Also I’m not able to set an image Placeholder because there is no placeholder field. So I can’t actually publish the plugin, even if I provide a preview function.

 ![01%20AM](https://us1.discourse-cdn.com/bubble/original/3X/7/9/79b55c42a1a17ff194149c6ea9daca73fad12d1c.png)

---

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [May 23, 2019, 5:05pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/7 "2019-05-23T17:05:08Z")

</div>

@steven.junio91 @JonL ushing a fix right now for the second issue. Can you provide repro steps for the 401 error message?

---

<div class="post-metadata">

**Author:** ![steven.junio91](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@steven.junio91](https://forum.bubble.io/u/steven.junio91)\
**Post date:** [May 23, 2019, 5:36pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/8 "2019-05-23T17:36:09Z")

</div>

Seems to be that I get the error unless the Preview function has this exact formatting as starting code. It has to be the same spacing and returns. Adding any sort of code or text throws the error.

 ![06%20AM](https://us1.discourse-cdn.com/bubble/original/3X/a/0/a03e2cbce2b37c950429b01c5225784021ad4678.png)

function(instance, properties) {

}

---

<div class="post-metadata">

**Author:** ![steven.junio91](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@steven.junio91](https://forum.bubble.io/u/steven.junio91)\
**Post date:** [May 23, 2019, 5:42pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/9 "2019-05-23T17:42:52Z")

</div>

Oh yeah it works after the plugin is published. The testing mode app doesn’t work

---

<div class="post-metadata">

**Author:** ![JonL](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.bubble.io/u/JonL)\
**Post date:** [May 23, 2019, 7:22pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/10 "2019-05-23T19:22:08Z")

</div>

Hi @marca will you guys push a fix to preview in unpublished mode?

---

<div class="post-metadata">

**Author:** ![robbertmastebroek](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robbertmastebroek/32/13490_2.png) [@robbertmastebroek](https://forum.bubble.io/u/robbertmastebroek)\
**Post date:** [May 23, 2019, 8:29pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/11 "2019-05-23T20:29:54Z")

</div>

Sweet! Seeing those placeholder images everywhere in the editor wasn’t the nicest UX, so this is pretty awesome. 👏

---

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [May 23, 2019, 8:45pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/12 "2019-05-23T20:45:47Z")

</div>

Certainly, as soon as we can reproduce it. So far I’ve not succeeded in getting it to break in unpublished mode. Further clues toward a reproduction case would be welcome–who else is seeing this bug, and under what circumstances?

---

<div class="post-metadata">

**Author:** ![JonL](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.bubble.io/u/JonL)\
**Post date:** [May 24, 2019, 5:53am UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/13 "2019-05-24T05:53:17Z")

</div>

These are conditions(that I can think of) about my scenario:

- Not published
- Private private
- Tested with a hobby plan
- Plugin files loaded externally
- No application authorised in plugin Settings
- No plugin editors added
- Container invisible on load

---

<div class="post-metadata">

**Author:** ![gurun](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gurun/32/458_2.png) [@gurun](https://forum.bubble.io/u/gurun)\
**Post date:** [May 24, 2019, 11:36am UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/14 "2019-05-24T11:36:54Z")

</div>

Thanks for looking into this @marca  
I was facing the exact same issues yesterday:

- Existing plugin
- Published
- Private
- Hobby plan for app tested with

I also tested with my test app authorized in test mode as well as without test mode. I removed and added the element in question each time I switched between test and non test to ensure no issues there.

Also tried with a nearly blank preview code to see if there was any part of the preview code failing, but seems to be unrelated.

From my perspective it seems like its a matter of a security mechanism, that the “origin” of the Bubble Editor is not allowed to request the iframe-component. It may have to do something with: token, cookie or IP address of the requesting browser not being whitelisted, thus a 401.

---

<div class="post-metadata">

**Author:** ![ronny.hom](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ronny.hom/32/39516_2.png) [@ronny.hom](https://forum.bubble.io/u/ronny.hom)\
**Post date:** [May 25, 2019, 5:01pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/15 "2019-05-25T17:01:31Z")

</div>

I am getting the same issue too:

 ![30%20AM](https://us1.discourse-cdn.com/bubble/original/3X/d/4/d44f17d5acfb873315fa3b38686cf7f6e81484f5.png)

And am running this by using “Go to test app -\>”:

![40%20AM](https://us1.discourse-cdn.com/bubble/original/3X/1/6/160cee8e0ae116eb496611e9d84599cf532bc51c.png)

Looking forward to hearing how to get to work

thank you

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [June 2, 2019, 9:14am UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/16 "2019-06-02T09:14:38Z")

</div>

Are the bugs solved

---

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [June 2, 2019, 11:40am UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/17 "2019-06-02T11:40:47Z")

</div>

The 401 bug is outstanding, but as of the end of Friday we finally got a workable repro case. From here it should be a quick and straightforward fix–we’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![panumathan](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@panumathan](https://forum.bubble.io/u/panumathan)\
**Post date:** [June 3, 2019, 3:10pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/18 "2019-06-03T15:10:43Z")

</div>

Any timeline on the bug resolution?

---

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [June 4, 2019, 6:25pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/19 "2019-06-04T18:25:55Z")

</div>

Tomorrow morning, I think.

---

<div class="post-metadata">

**Author:** ![marca](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/marca/32/25404_2.png) [@marca](https://forum.bubble.io/u/marca)\
**Post date:** [June 5, 2019, 5:27pm UTC](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489/20 "2019-06-05T17:27:22Z")

</div>

I just deployed a fix for the 401 bug.

[Next page](https://forum.bubble.io/t/new-feature-plugin-preview-rendering/57489.md?page=2)
