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

Fails to run on Vite #4003

Closed
hayato07 opened this issue Feb 12, 2024 · 6 comments · Fixed by #4004
Closed

Fails to run on Vite #4003

hayato07 opened this issue Feb 12, 2024 · 6 comments · Fixed by #4004

Comments

@hayato07
Copy link

hayato07 commented Feb 12, 2024

Steps for Reproduction

  1. install Vite
npm create vite@latest
# Select Vanilla, JavaScript
cd viteDir
  1. install quill
npm install quill@2.0.0-rc.0
import Quill from 'quill'

document.querySelector('#app').innerHTML = `
  <div>
    <div id="editor"></div>
  </div>
`

const quill = new Quill('#editor', {
    theme: 'snow'
});

Expected behavior:
editor will be displayed.

Actual behavior:
Error happened.

[vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/quill/modules/normalizeExternalHTML/normalizers/msWord.js:7:45: ERROR: Could not resolve "lodash"
    at failureErrorWithLog (/Users/hayato07/oss/quill/node_modules/esbuild/lib/main.js:1651:15)
    at /Users/hayato07/oss/quill/node_modules/esbuild/lib/main.js:1059:25
    at /Users/hayato07/oss/quill/node_modules/esbuild/lib/main.js:1527:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Platforms:
browser:
Google Chrome 121.0.6167.160(Official Build)(arm64)
OS:
macOS Ventura 13.2.1

Version:

"vite": "^5.1.0"
"quill": "^2.0.0-rc.0"

Run Quill.version to find out

@hayato07
Copy link
Author

after I installed lodash, The build failed error disappeared, but the editor didn't work.

npm install lodash

@luin
Copy link
Member

luin commented Feb 12, 2024

@hayato07 Thanks for reporting this. I'm working on a fix for the lodash issue. Can you expand on how the editor didn't work?

@hayato07
Copy link
Author

@luin

Thank you for checking.
The attached screen will be displayed.

image

@luin
Copy link
Member

luin commented Feb 12, 2024

Looks like the style is missing. Can you check if you included the CSS files required by Quill? https://v2.quilljs.com/docs/installation

@hayato07
Copy link
Author

It worked fine thanks to you.

+import 'quill/dist/quill.snow.css'

I would like the documentation to mention that lodash must be installed.

@luin
Copy link
Member

luin commented Feb 12, 2024

The requirement of lodash is a bug and will not be needed in the next release.

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

Successfully merging a pull request may close this issue.

2 participants