joelcolucci / node-quill-converter

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

Can't import js library 'node-quill-converter' #25

Open Elwazer007 opened 2 years ago

Elwazer007 commented 2 years ago

I 'm trying to install this library in a react-typescript app for quill node-quill-converte but i can't import it it exists in my node_modules folder after successful installation but while trying

import {convertTextToDelta} from 'node-quill-converter-improved'

It gets me an error that this path to library doesn't exist i 've also tried

const { convertTextToDelta } = require('node-quill-converter-improved');

it shows me this error

TypeError: fs.readFileSync is not a function

(anonymous function) node_modules/node-quill-converter-improved/lib/index.js:10 7 | let quillFilePath = require.resolve("quill"); 8 | let quillMinFilePath = quillFilePath.replace("quill.js", "quill.min.js"); 9 |

10 | let quillLibrary = fs.readFileSync(quillMinFilePath); 11 | let mutationObserverPolyfill = fs.readFileSync( 12 | path.join(__dirname, "polyfill.js") 13 | );

Fred-wizard commented 2 years ago

hi,bro i have the same problem,have you resolve this?