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

Wrap fastembed in try catch to allow non node environments to build #508

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

antpb
Copy link
Contributor

@antpb antpb commented Nov 22, 2024

Relates to: #507

Non node.js environments may have issues building because of some packages and how they are imported.

##To Reproduce

Make a worker, include eliza/core and attempt to build. It will throw an error similar to

✘ [ERROR] No loader is configured for ".node" files:
node_modules/@anush008/tokenizers-darwin-universal/tokenizers.darwin-universal.node

  node_modules/@anush008/tokenizers/index.js:116:32:
    116 │ ... nativeBinding = require('@anush008/tokenizers-darwin-universal')

Expected behavior

image

This PR wraps the import in try catch to gracefully fail and allow the build.

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for getting this out!

@jkbrooks jkbrooks merged commit 10aa5d6 into elizaOS:main Nov 22, 2024
1 of 2 checks passed
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.

3 participants