Skip to content

fromBuffer doesn't work in ESM projects #1308

@benmccann

Description

@benmccann

Expected Behavior

Doesn't crash

Current Behavior

Crashes

Failure Information (for bugs)

Steps to Reproduce

Create a new project with "type": "module" and then do await Jimp.fromBuffer(buffer);

Context

  • Jimp Version: 1.1.0
  • Operating System: Linux
  • Node version: 20.17.0

Failure Logs

node_modules/.pnpm/@jimp+core@1.1.0/node_modules/@jimp/core/dist/esm/index.js:161
            const mime = await fileType.fromBuffer(actualBuffer);
                                        ^

TypeError: fileType.fromBuffer is not a function
    at Jimp.fromBuffer (node_modules/.pnpm/@jimp+core@1.1.0/node_modules/@jimp/core/dist/esm/index.js:161:41)

Metadata

Metadata

Assignees

No one assigned

    Labels

    releasedThis issue/pull request has been released.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions