Gjs-preset-newsletter not found
Hi @artf thanks for the pointer 💃 , the above code was throwing an error nlPlugin not a function, doing this helped it run thanks a lot again 👍
Read full answer below ↓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 #5000
Localization works weird
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 111 Reproducible demo link https://...
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...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.