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

Error import sharp in vuejs #2866

Closed
nhokvouu opened this issue Aug 28, 2021 · 2 comments
Closed

Error import sharp in vuejs #2866

nhokvouu opened this issue Aug 28, 2021 · 2 comments
Labels

Comments

@nhokvouu
Copy link

I can import sharp in vuejs

error in ./node_modules/sharp/node_modules/color/index.js

Module parse failed: Identifier directly after number (257:26)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| for (const [i, element] of rgb.entries()) {
| const chan = element / 255;

                  lum[i] = (chan <= 0.039_28) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;

| }
|

@ ./node_modules/sharp/lib/colour.js 3:14-30
@ ./node_modules/sharp/lib/index.js

@lovell
Copy link
Owner

lovell commented Aug 28, 2021

sharp requires a Node.js runtime, so won't work in a web browser.

@lovell lovell added question and removed triage labels Aug 28, 2021
@lovell
Copy link
Owner

lovell commented Sep 23, 2021

I hope this information helped. Please feel free to re-open with more details if further assistance is required.

@lovell lovell closed this as completed Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants