# Every new snippet makes de snippet plugin/library unavailable and/or destroys it

**URL:** https://forum.pinegrow.com/t/every-new-snippet-makes-de-snippet-plugin-library-unavailable-and-or-destroys-it/3226
**Category:** General
**Created:** [August 3, 2019, 4:43pm UTC](https://forum.pinegrow.com/t/every-new-snippet-makes-de-snippet-plugin-library-unavailable-and-or-destroys-it/3226 "2019-08-03T16:43:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cifra](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/cifra/32/2179_2.png) [@cifra](https://forum.pinegrow.com/u/cifra)
#### Post date: [August 3, 2019, 4:43pm UTC](https://forum.pinegrow.com/t/every-new-snippet-makes-de-snippet-plugin-library-unavailable-and-or-destroys-it/3226/1 "2019-08-03T16:43:23Z")

</div>

So here’s the thing: I created a PG project called CanvasSnippets. Canvas is a multi page template and I’m making my own collection of snippets.

So, when I open one template page to save a snippet out of it, I go to `Page -> Manage Libraries & Plugins` (I’ve also tried using `File -> Manage Libraries & Plugins`), I load and activate my CanvasSnippets.js and my blocks load in the components panel.

I add a few snippets, rename them… and open the next template page. Now, those snippets are gone. I check with `Page -> Manage Libraries & Plugins`, it’s listed there but not active. So I go to activate it and I get something like “This thing is already activate it, you have to disable it first”.  
Then, I go to `File -> Manage Libraries & Plugins` and it’s there activated! But still disappeared from the components panel. So I deactivate and activate again. No errors but still not showing there.

I close the whole project and start again. Now it works. I do a couple snippets and again with the same issue 😡

Worst of all, this time, I go to check on that \*.js where the snippets are and they are all gone. There’s only this skeleton:

```
$(function() {

    //Wait for Pinegrow to wake-up
    $("body").one("pinegrow-ready", function(e, pinegrow) {

        //Create new Pinegrow framework object
        var f = new PgFramework("CanvasSnippets", "CanvasSnippets");

        //This will prevent activating multiple versions of this framework being loaded
        f.type = "CanvasSnippets";
        f.allow_single_type = true;
        f.user_lib = true

        //Tell Pinegrow about the framework
        pinegrow.addFramework(f);
            
        var section = new PgFrameworkLibSection("CanvasSnippets_lib", "Components");
        //Pass components in array
        section.setComponentTypes([]);

        f.addLibSection(section);
   });
});

```

Here’s when I realize I can’t trust PG with any file, so thank god I had GIT working from the get go.

So, **1)** the library disappearing every time I open a new page is so frustrating, am I at fault here?. **2)** PG will just eat hours of snippetting for no apparent reason.

Help?

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [August 4, 2019, 4:09am UTC](https://forum.pinegrow.com/t/every-new-snippet-makes-de-snippet-plugin-library-unavailable-and-or-destroys-it/3226/2 "2019-08-04T04:09:33Z")

</div>

Hi @cifra, sorry to hear about that. We’re investigating the issue. So far I was not able to replicate it. Does it happen every time you do those steps?

---

<div class="post-metadata">

### Author: ![cifra](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/cifra/32/2179_2.png) [@cifra](https://forum.pinegrow.com/u/cifra)
#### Post date: [August 4, 2019, 8:48am UTC](https://forum.pinegrow.com/t/every-new-snippet-makes-de-snippet-plugin-library-unavailable-and-or-destroys-it/3226/3 "2019-08-04T08:48:53Z")

</div>

Giving I was confused between components, resources, and libraries (and have the option of loading a project as a library or as a plugin), I salvaged the last good version of the snippets \*.js file from git and started the everything else from scratch.

There are still some inconsistencies. For example, the first time I start creating snippets, it says “Snippets” on the components bar, which makes sense. But later on, I load it as a plugin to keep adding bits of HTML; then it shows as “Components.”

Now it works almost like expected. I think I opened a different thread for the issue of hovering over the snippet and seeing a rendered image that’s just HTML. So it looks all ugly and without layout.

I am looking forward to a better PG with better docs.

Thank you
