Skip to content

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

Merged
jkbrooks merged 3 commits into
elizaOS:mainfrom
antpb:fix/gracefully-pull-node-dep
Nov 22, 2024
Merged

Wrap fastembed in try catch to allow non node environments to build#508
jkbrooks merged 3 commits into
elizaOS:mainfrom
antpb:fix/gracefully-pull-node-dep

Conversation

@antpb

@antpb antpb commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

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.

@mcp97 mcp97 left a comment

Copy link
Copy Markdown
Contributor

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
lalalune pushed a commit that referenced this pull request May 3, 2026
Wrap `fastembed` in try catch to allow non node environments to build
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