fix: resolve webpack import.meta warning in browser extension#1322
Open
devlux76 wants to merge 1 commit intohuggingface:mainfrom
Open
fix: resolve webpack import.meta warning in browser extension#1322devlux76 wants to merge 1 commit intohuggingface:mainfrom
devlux76 wants to merge 1 commit intohuggingface:mainfrom
Conversation
- Add parser configuration to disable import.meta parsing in webpack - Suppress critical dependency warnings from @huggingface/transformers - Add Node.js fallbacks for browser compatibility (fs, path, url) - Ensures clean build without warnings while maintaining ML functionality - Extension now builds successfully for both development and production Resolves webpack 5 compatibility issue with Transformers.js library when bundling for browser extension environment.
Collaborator
|
Hi there 👋 thanks for the PR! We're in the process of moving our examples to https://github.com/huggingface/transformers.js-examples/tree/main/browser-extension; can you check if this is still an issue in that example? Thanks! |
|
Hi! @xenova I just checked, and it is still an issue. I ran current "transformers.js-examples" and got this build error: I also tried to apply changes suggested in this PR. the PR itself works, but it is missing the lines below when compared to the current "-extensions" solution. when this is added (to match current "transformers.js-examples"), the error in the build.log above appears again. |
|
there is actually a pull request in transformer.js-examples to fix this example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves webpack 5 compatibility issue with Transformers.js library when bundling for browser extension environment.