Skip to content

Build Error Due to path Dependency in mime-types #344

Closed
@kang8

Description

@kang8

I've encountered a build issue when using the jira.js library version v4.0.4, which seems to stem from the introduction of the mime-types module. The error message is as follows:

Module not found: Can't resolve 'path'
  14 |
  15 | var db = require('mime-db')
> 16 | var extname = require('path').extname
     | ^
  17 |
  18 | /**
  19 |  * Module variables.

Upon investigation, it appears that this issue is due to mime-types relying on the Node.js core module path. As this module is not available in browser environments, attempts to build jira.js for such environments fail.

The maintainers of mime-types have addressed this concern in this issue by stating that:

The path dependency is a part of Node.js core. It is used for a good reason and we're not interested in removing it. Your alternative is to just use the mime module.

Given this, using the mime package instead of mime-types might be a viable solution, as it provides the same mappings but is more suitable for browser environments.

I hope this can be resolved in a future release to ensure compatibility with browser-based builds.

Thank you for your consideration and for maintaining such a valuable library.

Metadata

Metadata

Assignees

Labels

bugIndicates a reported issue or malfunction that needs fixing.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions