Skip to content

Failed to parse sourcemap when bundling with webpack #1353

Open
@DanielOrtel

Description

@DanielOrtel

Expected Behavior

Source map can be correctly parsed by bundlers.

Current Behavior

[email protected] fails to parse source maps, throws the following error:

Failed to parse source map from '/path/to/project/node_modules/jimp/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/to/project/node_modules/jimp/src/index.ts'

Failure Information (for bugs)

Jimp only exports the dist folder to npm, however the index.js.map has a direct reference to the src/index.ts, which is not included on npm:

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[], ...}

the source file loader then tries to parse the sources array, but since it's missing, it throws a ENOENT

Steps to Reproduce

  1. import jimp into a file
  2. try to bundle with a barebones webpack config

Screenshots

Context

  • Jimp Version: 1.6.0
  • Operating System: MacOS Ventura 13.3
  • Node version: 20.18

Failure Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions