Issue #1337Opened August 4, 2018by mgebeily0 reactions

[Question] Loading from package in TypeScript giving undefined error.

Question

Similar to issue #902 but I can't seem to resolve with the steps taken in that discussion.

I'm using the latest version of Angular, Webpack, and TypeScript.

I'm able to get the editor itself up fine. However, when I try to import grapesjs-preset-newsletter, I'm getting grapesjs is not defined. My imports look like this:

import grapesjs from "grapesjs";
import grapesjsNewsletters from "grapesjs-preset-newsletter";

Then, in ngOnInit, I'm calling:

grapesjs.init({
  container: '#grapes-editor',
  plugins: ['gjs-preset-newsletter'],
})

This doesn't load the preset. The interesting thing is if I have grapesjsNewsletters anywhere in my code, I get grapesjs is not defined.

Am I missing something blatant about how webpack or TypeScript imports work with grapesjs presets?

Thank you for your help in advance. Your library has been excellent to work with.

Answers (3)

artfAugust 9, 20180 reactions

It's happening just because grapesjs-preset-newsletter uses an old way of loading the plugin, I'll fix it soon

devexcelsiorApril 15, 20190 reactions

Im having the same issue, was this ever resolved?

lock[bot]April 15, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.