[QUESTION] gjs-preset-newsletter not found
Question
I am new to posting issues on github,
i am using latest version of both GrapesJS and newsletter preset from npm
i have done
var grapesjs = require('grapesjs');
require('grapesjs-preset-newsletter');
and
ngOnInit() {
var editor = grapesjs.init({
container: '#gjs',
plugins: ['gjs-preset-newsletter'],
pluginsOpts: {
'gjs-preset-newsletter': {}
}
});
}
if i follow the same process for webpage preset it works fine, only newsletter preset i get an error in console saying gjs-preset-newsletter not found. i am trying to create a component in angular
any help would be appreciated thanks :)Answers (3)
Hi @artf thanks for the pointer 💃 , the above code was throwing an error nlPlugin not a function,
doing this helped it run
var grapesjs = require('grapesjs');
var nlPlugin = require('grapesjs-preset-newsletter');
grapesjs.plugins.add('gjs-preset-newsletter-2', nlPlugin.default);
...
plugins: ['gjs-preset-newsletter-2'],
thanks a lot again 👍
Hi @isaacnikon and welcome on board :)
Btw grapesjs-preset-newsletter is not added in a proper way if you want to load it globally, try with this instead
var grapesjs = require('grapesjs');
var nlPlugin = require('grapesjs-preset-newsletter');
grapesjs.plugins.add('gjs-preset-newsletter-2', nlPlugin);
...
plugins: ['gjs-preset-newsletter-2'],
@isaacnikon Hei, .default does the magic. Thanks! 👍
Also giga thanks to @artf for these awesome plugins ! ! ! 🙌
Related Questions and Answers
Continue research with similar issue discussions.
Issue #384
Create and Edit Template into Database
This is my code to Create a new template and insert the inline html with style into the database : I am able to insert the template-data in...
Issue #998
[BUG] Asset Manager sends empty request when uploading image
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The conte...
Issue #1620
[Question] Can't edit Text on Block
I wrote a plugin that defines a new Block for a simple headline. However when I drag and drop this block to the canvas I get the placeholde...
Issue #696
click binding question
Hello everyone, I'm new to all of this and I've been going through the documentation but I still dont understand how to bind click event. I...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.