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

TypeError: Jimp.read is not a function #1350

Open
syomna opened this issue Oct 11, 2024 · 1 comment
Open

TypeError: Jimp.read is not a function #1350

syomna opened this issue Oct 11, 2024 · 1 comment

Comments

@syomna
Copy link

syomna commented Oct 11, 2024

I expect to be able to use the Jimp.read() function to load and manipulate images without encountering an error.
The Jimp.read() function is throwing a Jimp.read is not a function error, and I'm unable to proceed with loading images.

>    <rejected> TypeError: Jimp.read is not a function
>        at processImageWithCorrections (/Users/yomna/Coding/Mobile Apps/Work/wright/functions/services/services.js:86:30)
>        at /Users/yomna/Coding/Mobile Apps/Work/wright/functions/index.js:41:28
>        at async runFunction (/Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:506:9)
>        at async runHTTPS (/Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:531:5)
>        at async /Users/yomna/.nvm/versions/node/v18.20.4/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:694:21
  1. Install Jimp version 1.6.0 using npm.
  2. Use the following code to load an image:
    const Jimp = require('jimp');
    
    Jimp.read(imageUrl)
      .then(image => {
        // manipulate image
      })
      .catch(err => {
        console.error(err);
      });
  3. Run the script and observe the error: Jimp.read is not a function.
  • Jimp Version: 1.6.0
  • Operating System: macOS Sequoia
  • Node version: 18.20.4
@DanielOrtel
Copy link

const {Jimp} = require('jimp')

Jimp no longer exposes a default export. See: https://jimp-dev.github.io/jimp/guides/migrate-to-v1/

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

No branches or pull requests

2 participants