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

fix: Declare isArrayBufferView as native Node.js function to resolve module import error #81

Conversation

hernanr99
Copy link
Contributor

@hernanr99 hernanr99 commented Mar 4, 2024

Description

This pull request addresses a module import error encountered when installing the library in a project. The error manifested as follows:

[!] RollupError: "util/types" is imported by "node_modules/@svta/common-media-library/dist/id3/util/utf8.js", but could not be resolved – treating it as an external dependency.
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
node_modules/@svta/common-media-library/dist/id3/util/utf8.js

The underlying cause was the dependency on isArrayBufferView in the util/types module of Node.js. To resolve this issue and avoid future conflicts with direct imports of Node.js modules, we decided to declare isArrayBufferView as a native function, thus eliminating the need to import it directly from util/types.

This change implements isArrayBufferView as an auxiliary function in the code, ensuring that the previous functionality remains intact while resolving the module import error.

Requirements Checklist

  • Unit Tests updated or fixed
  • Docs/guides updated

@hernanr99 hernanr99 requested review from a team as code owners March 4, 2024 17:31
@hernanr99 hernanr99 marked this pull request as draft March 4, 2024 17:31
@hernanr99 hernanr99 changed the title Remove isArrayBufferView import and create as auxiliary function fix: Declare isArrayBufferView as native Node.js function to resolve module import error Mar 4, 2024
Copy link
Collaborator

@littlespex littlespex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a change log entry under 0.6.4.

@littlespex littlespex changed the base branch from main to release/0.6.4 March 4, 2024 18:01
@hernanr99 hernanr99 marked this pull request as ready for review March 4, 2024 18:26
CHANGELOG.md Outdated Show resolved Hide resolved
hernanr99 and others added 4 commits March 4, 2024 15:31
Signed-off-by: hernan <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
Co-authored-by: Casey Occhialini <[email protected]>
Signed-off-by:  Hernán Reyes <[email protected]>
Signed-off-by: hernan <[email protected]>
@hernanr99 hernanr99 force-pushed the fix/decodeId3ImageFrame branch from 5ec25ca to 4c37290 Compare March 4, 2024 18:34
Copy link

@mpollingerQualabs mpollingerQualabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comment, LGTM.

lib/src/id3/util/utf8.ts Show resolved Hide resolved
@littlespex littlespex merged commit 2c94c86 into streaming-video-technology-alliance:release/0.6.4 Mar 4, 2024
2 checks passed
littlespex added a commit that referenced this pull request Mar 4, 2024
…se/0.6.4

* chore: update version to 0.6.4
* fix: Declare isArrayBufferView as native Node.js function to resolve module import error (#81)
* Remove isArrayBufferView import and create as auxiliary function

see:  #83 

---------

Signed-off-by: Casey Occhialini <[email protected]>
Signed-off-by: hernan <[email protected]>
Signed-off-by: Hernán Reyes <[email protected]>
Co-authored-by: Hernán Reyes <[email protected]>
littlespex pushed a commit to qualabs/common-media-library that referenced this pull request Apr 5, 2024
…module import error (streaming-video-technology-alliance#81)

* Remove isArrayBufferView import and create as auxiliary function

see:  streaming-video-technology-alliance#83

---------

Signed-off-by: hernan <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
Signed-off-by: Hernán Reyes <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
littlespex pushed a commit to qualabs/common-media-library that referenced this pull request Apr 5, 2024
…module import error (streaming-video-technology-alliance#81)

* Remove isArrayBufferView import and create as auxiliary function

see:  streaming-video-technology-alliance#83

---------

Signed-off-by: hernan <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
Signed-off-by: Hernán Reyes <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
littlespex pushed a commit to qualabs/common-media-library that referenced this pull request Apr 5, 2024
…module import error (streaming-video-technology-alliance#81)

* Remove isArrayBufferView import and create as auxiliary function

see:  streaming-video-technology-alliance#83

---------

Signed-off-by: hernan <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
Signed-off-by: Hernán Reyes <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
littlespex pushed a commit that referenced this pull request Jun 5, 2024
…module import error (#81)

* Remove isArrayBufferView import and create as auxiliary function

see:  #83

---------

Signed-off-by: hernan <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
Signed-off-by: Hernán Reyes <[email protected]>
Signed-off-by: Casey Occhialini <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants