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

Image Processing #270

Closed
fabianwohlfart opened this issue Sep 9, 2024 · 1 comment
Closed

Image Processing #270

fabianwohlfart opened this issue Sep 9, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@fabianwohlfart
Copy link

Describe the bug
It's not possible to use several image processing libraries.
I tried: sharp, @cf-wasm/photon, image-js.

[error] Cannot resolve "@img/sharp-wasm32/versions" from "/opt/buildhome/repo/node_modules/sharp/lib/utility.js" and externals are not allowed!
12:06:45.291   at Object.resolveId (node_modules/nitropack/dist/nitro.mjs:1970:17)
12:06:45.291   at async PluginDriver.hookFirstAndGetPlugin (node_modules/rollup/dist/es/shared/node-entry.js:19818:28)
12:06:45.291   at async resolveId (node_modules/rollup/dist/es/shared/node-entry.js:18509:26)
12:06:45.291   at async ModuleLoader.resolveId (node_modules/rollup/dist/es/shared/node-entry.js:18912:15)
12:06:45.291   at async node_modules/@rollup/plugin-commonjs/dist/es/index.js:785:16
12:06:45.291   at async Promise.all (index 5)
12:06:45.291   at async node_modules/@rollup/plugin-commonjs/dist/es/index.js:777:32
12:06:45.292   at async rewriteRequireExpressionsAndGetImportBlock (node_modules/@rollup/plugin-commonjs/dist/es/index.js:1354:28)
12:06:45.292   at async transformCommonjs (node_modules/@rollup/plugin-commonjs/dist/es/index.js:1933:23)
12:06:45.292   at async transform (node_modules/rollup/dist/es/shared/node-entry.js:18830:16) 

Steps to reproduce
Steps to reproduce the behavior:
npm install sharp

Expected behavior
The only library i could get to work is jimp.
If I understand correctly its a cloudflare thing not to allow externals.
Unfortunately I do not even know what is meant by this and there is no documentation for it.
Would be great to have a short example on how to do basic image processing like resizing in NuxtHub.
I wonder if this also breaks NuxtImage as this also relies on sharp?

@atinux
Copy link
Contributor

atinux commented Sep 9, 2024

Duplicate of #131

Please feel free to comment on it as I would like to explore @cf-wasm/photon

@atinux atinux closed this as completed Sep 9, 2024
@atinux atinux added the duplicate This issue or pull request already exists label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants