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

[Bug]: Issues importing chromadb UnhandledSchemeError: Reading from "https://unpkg.com/@xenova/transformers@2.13.2" #2988

Open
ashbuilds opened this issue Oct 22, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ashbuilds
Copy link

What happened?

Hi, Im trying to import chromadb into my nextjs server but getting the issue UnhandledSchemeError: Reading from "https://unpkg.com/@xenova/transformers@2.13.2", I tried to mark this as external modules but it doesn't work. Is there any workaround? Thank you!

Versions

chromadb: 1.9.2, node v22.10.0

Relevant log output

⨯ https://unpkg.com/@xenova/transformers@2.13.2
Module build failed: UnhandledSchemeError: Reading from "https://unpkg.com/@xenova/transformers@2.13.2" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "https:" URIs.
Import trace for requested module:
https://unpkg.com/@xenova/transformers@2.13.2
./node_modules/.pnpm/chromadb@1.9.1_openai@4.68.1_zod@3.23.8_/node_modules/chromadb/dist/chromadb.mjs
@ashbuilds ashbuilds added the bug Something isn't working label Oct 22, 2024
@CarmineXmX
Copy link

same problem

@BrianMwangi21
Copy link

Any new feedback on this ? Getting the same issue.

@itaismith itaismith self-assigned this Oct 24, 2024
@fortysevenlabs
Copy link

If we are using an alternative embedding like OpenAI, why does @xenova/transformers / chromadb-default-embeddings even need to be installed? Can we make this optional as well?

@ashbuilds
Copy link
Author

This is my workaround for now, but would be great if this can be optional.


  webpack: (config, { isServer }) => {
    config.externals = config.externals || [];
    
    // TODO: Workaround for issue : https://github.com/chroma-core/chroma/issues/2988
    config.externals.push({
      'https://unpkg.com/@xenova/transformers@2.13.2': 'transformers',
    });
    return config;
  }

@ChrisCates
Copy link

The workaround mentioned by @ashbuilds didn't work by just doing that alone.
However, it worked when I simply just installed the dependencies.

cohere-ai
@xenova/transformers
chromadb-default-embed

I'd like to avoid having to install dependencies... and then still have it direct to a CDN, I'll throw a PR at Chroma tomorrow to make sure that you dont need chroma's dependencies in your own package.json.

@ashbuilds
Copy link
Author

The workaround mentioned by @ashbuilds didn't work by just doing that alone.
However, it worked when I simply just installed the dependencies.

cohere-ai
@xenova/transformers
chromadb-default-embed

I'd like to avoid having to install dependencies... and then still have it direct to a CDN, I'll throw a PR at Chroma tomorrow to make sure that you dont need chroma's dependencies in your own package.json.

Hi, yes you need @xenova/transformers package to be installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants