Quill modules usage

See original GitHub issue

HI Do you have an example of how to use quill modules with react-quill.

I could not get quill-markdown-shortcuts to work. Here is the code:

import ReactQuill,  { Quill } from 'react-quill';
import { MarkdownShortcuts} from 'quill-markdown-shortcuts';
Quill.register('MarkdownShortcuts', MarkdownShortcuts);

...
render() {
...
        <ReactQuill value={'abcd'}
          modules={{
            MarkdownShortcuts: {}
          }}
        />
...
}
...

This is the Error that I get:

quill Cannot import modules/MarkdownShortcuts. Are you sure it was registered?
quill Cannot load MarkdownShortcuts module. Are you sure you registered it?
quill Cannot import modules/MarkdownShortcuts. Are you sure it was registered?
Uncaught TypeError: moduleClass is not a constructor
    at SnowTheme.addModule (quill.js:6052)
    at SnowTheme.addModule (quill.js:6696)

React-Quill version

1.3.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:23
  • Comments:8

github_iconTop GitHub Comments

4reactions
pirsquarecommented, Jun 5, 2020

I’ve encountered similar issue while using original quilljs (not react-quill) and managed to solve it. In my case, it is due to invalid modules added to quill config.

// Original Config
const quillOptions = {
  modules: {
    toolbar: `quill-toolbar`,
    variable: {}
  }
};

After removing variable from modules, it worked for me.

// Fixed Config
const quillOptions = {
  modules: {
    toolbar: `quill-toolbar`
  }
};

For anyone encountering this issue, you may want to check if you’ve added unregistered modules to your config.

0reactions
osbeug001commented, Dec 4, 2022

I had a similar issue when importing and registering a module, my solution was to:

  1. Import the module from the dist folder : import BlotFormatter from 'quill-blot-formatter/dist/BlotFormatter'
  2. When registering, register the module’s default.: Quill.register('modules/blotFormatter', BlotFormatter.default);

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Custom Module - Quill Rich Text Editor
Modules are passed an options object that can be used to fine tune the desired behavior. We can use this to accept a...
Read more >
Modules | VueQuill - GitHub Pages
Modules allow Quill's behavior and functionality to be customized. To enable a module, simply include it in a modules prop. Example #. In...
Read more >
javascript - Quill - how to use modules? - Stack Overflow
I'v got access to the quill instance after initialising it: let quillContainerSelector = '.quill-container'; let quill = new Quill( ...
Read more >
Usage of Quill modules in angular universal #1492 - GitHub
I have already read all of the content of the following related Issues: #91 and #57. Error: When running dev:ssr i get the...
Read more >
Build a WYSIWYG text editor using Quill - LogRocket Blog
Quill allows users to control which toolbar features to use. The supported options can be divided by the way they are being displayed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found