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

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

Closed
kang8 opened this issue Jan 6, 2025 · 0 comments · Fixed by #345
Closed

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

kang8 opened this issue Jan 6, 2025 · 0 comments · Fixed by #345
Assignees
Labels
bug Indicates a reported issue or malfunction that needs fixing.
Milestone

Comments

@kang8
Copy link

kang8 commented Jan 6, 2025

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.

@MrRefactoring MrRefactoring self-assigned this Jan 6, 2025
@MrRefactoring MrRefactoring added this to the v4.0.5 milestone Jan 6, 2025
@MrRefactoring MrRefactoring added the bug Indicates a reported issue or malfunction that needs fixing. label Jan 6, 2025
@MrRefactoring MrRefactoring linked a pull request Jan 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates a reported issue or malfunction that needs fixing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants