patleeman / quill-markdown-shortcuts

Quill.js module that converts markdown to rich text formatting while typing.
https://patleeman.github.io/quill-markdown-shortcuts/
140 stars 49 forks source link

Demo website fails to import Quill Markdown #30

Open Betree opened 5 years ago

Betree commented 5 years ago

Hi there,

The demo website (https://patleeman.github.io/quill-markdown-shortcuts/) is failing to import Quill Markdown with the following message:

hr.js:3 Uncaught TypeError: Cannot read property 'import' of undefined
    at Object.<anonymous> (hr.js:3)
    at __webpack_require__ (bootstrap 20916322352f1adaeb92:19)
    at Object.<anonymous> (index.js:30)
    at __webpack_require__ (bootstrap 20916322352f1adaeb92:19)
    at bootstrap 20916322352f1adaeb92:62
    at bootstrap 20916322352f1adaeb92:62
    at webpackUniversalModuleDefinition (universalModuleDefinition:9)
    at universalModuleDefinition:10
quill.js:1974 quill Cannot import modules/markdownShortcuts. Are you sure it was registered?
debug @ quill.js:1974
quill.js:1974 quill Cannot load markdownShortcuts module. Are you sure you registered it?
debug @ quill.js:1974
quill.js:1974 quill Cannot import modules/markdownShortcuts. Are you sure it was registered?
debug @ quill.js:1974
quill.js:5451 Uncaught TypeError: moduleClass is not a constructor
    at SnowTheme.addModule (quill.js:5451)
    at SnowTheme.addModule (quill.js:6531)
    at quill.js:5443
    at Array.forEach (<anonymous>)
    at SnowTheme.init (quill.js:5441)
    at new Quill (quill.js:1100)
    at (index):103

Tested on Chrome and Firefox, Linux.

petemcfarlane commented 4 years ago

👍 and Safari fails too

Screenshot 2019-11-22 at 13 51 44
ghost commented 4 years ago

i have same problem. Screenshot from 2019-12-04 16-47-32

xueqiliu commented 4 years ago

I have same problem. Has anyone solved it ?

petemcfarlane commented 4 years ago

Not solved it, but the demo importing as a module works which you may find useful: https://patleeman.github.io/quill-markdown-shortcuts/module/

amos-chen commented 4 years ago
(function webpackUniversalModuleDefinition(root, factory) {
  if(typeof exports === 'object' && typeof module === 'object')
        module.exports = factory(require("quill"));
    else if(typeof define === 'function' && define.amd)
        define(["quill"], factory);
    else if(typeof exports === 'object')
        exports["MarkdownShortcuts"] = factory(require("quill"));
    else
    root["MarkdownShortcuts"] = factory(root["quill"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
return /******/ (function(modules) { // ### webpackBootstrap

It is because the quill is not import properly, change the word quill to Quill and it will work!