Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Import Full Toolbar? #6

Closed
gunjandatta opened this issue Jul 25, 2022 · 2 comments
Closed

How to Import Full Toolbar? #6

gunjandatta opened this issue Jul 25, 2022 · 2 comments

Comments

@gunjandatta
Copy link

gunjandatta commented Jul 25, 2022

Here is an attempt to import the library using this example. It's not rendering the toolbar as expected. How can you import and use only the Toolbar w/ all/most of the options?

import Quill from "quill/core";

// Modules
import Toolbar from "quill/modules/toolbar";

// Themes
import BubbleTheme from "quill/themes/bubble";
import Snow from "quill/themes/snow";

// Toolbar Components
import Blockquote from "quill/formats/blockquote"
import Bold from "quill/formats/bold";
import CodeBlock from "quill/formats/code";
import Italic from "quill/formats/italic";
import Header from "quill/formats/header";
import Image from "quill/formats/image";
import List from "quill/formats/list";
import Script from "quill/formats/script";
import Strike from "quill/formats/strike";
import Underline from "quill/formats/underline";
import Video from "quill/formats/video";

// Register the components
Quill.register({
    "modules/toolbar": Toolbar,
    "formats/blockquote": Blockquote,
    "formats/bold": Bold,
    "formats/code": CodeBlock,
    "formats/italic": Italic,
    "formats/header": Header,
    "formats/image": Image,
    "formats/list": List,
    "formats/script": Script,
    "formats/strike": Strike,
    "formats/underline": Underline,
    "formats/video": Video,
    "themes/bubble": BubbleTheme,
    "themes/snow": Snow
});

export default Quill;

image

@sebastianwestberg
Copy link

sebastianwestberg commented Feb 10, 2023

HI @gunjandatta - I'm running into the exact same problem with [object Module] and missing icons. Did you ever solve this? Thanks in advance!
Screenshot 2023-02-10 at 12 59 57

@oliviasculley
Copy link

So it seems like this is caused by an incompatibility with html-loader attempting to use the new ES modules syntax. I was able to fix it by changing the webpack rule for .svgs like this:

        {
          test: /\.svg$/,
          loader: 'html-loader',
          options: {
            esModule: false
          }
        }

This issue on webpack and this issue on html-loader have more details. Hopefully this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants