joelcolucci / node-quill-converter

Convert HTML to a Quill Delta or a Quill Delta to HTML
MIT License
95 stars 25 forks source link

TypeError: fs.readFileSync is not a function #9

Closed fershibli closed 5 years ago

fershibli commented 5 years ago

I've just saved this package in my react project and imported like this:

import { convertHtmlToDelta, convertDeltaToHtml } from 'node-quill-converter';

But got this error:

Uncaught TypeError: fs.readFileSync is not a function at Object.<anonymous> (:4200/static/js/0.chunk.js:490006) at Object../node_modules/node-quill-converter/lib/index.js (:4200/static/js/0.chunk.js:490032) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/components/Editor.js (:4200/static/js/main.chunk.js:2326) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/components/admin/ModalityTemplateCRUD/ModalityTemplateForm.js (:4200/static/js/main.chunk.js:7473) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/components/admin/ModalityTemplateCRUD/index.js (:4200/static/js/main.chunk.js:7810) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/pages/AdminPage.js (:4200/static/js/main.chunk.js:22831) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/App.js (:4200/static/js/main.chunk.js:69) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Module../src/index.js (:4200/static/js/main.chunk.js:22779) at __webpack_require__ (:4200/static/js/bundle.js:782) at fn (:4200/static/js/bundle.js:150) at Object.0 (:4200/static/js/main.chunk.js:33635) at __webpack_require__ (:4200/static/js/bundle.js:782) at checkDeferredModules (:4200/static/js/bundle.js:46) at Array.webpackJsonpCallback [as push] (:4200/static/js/bundle.js:33) at :4200/static/js/main.chunk.js:1

Version: 0.3.2

joelcolucci commented 5 years ago

Hi @FernandoLuizNemeChibli, Thank you for your patience.

This package is designed to run in Node. Currently, it does not support use in the browser.

Please let me know if you have any questions. I am happy to help!