GithubHelp home page GithubHelp logo

Comments (5)

JonahElbaz avatar JonahElbaz commented on August 26, 2024

Resolved by looking at the exports in package.json and altering the import. That being said, Typescript won't accept the import so I need to @ts-ignore it

// @ts-ignore
import { PineconeDb } from '@llm-tools/embedjs/vectorDb/pinecone';
// @ts-ignore
import { LmdbCache } from '@llm-tools/embedjs/cache/lmdb'

Otherwise I get
TS2307: Cannot find module @llm-tools/embedjs/cache/lmdb or its corresponding type declarations.

from embedjs.

adhityan avatar adhityan commented on August 26, 2024

This should not be the case. Look at the sample project written in TS -

EmbedJS Slack Bot

I have updated the documentation to make it clear what the import paths should be. For your TS error, could you share with me your tsconfig.json file and node version?

from embedjs.

JonahElbaz avatar JonahElbaz commented on August 26, 2024

Thanks for updating the documentation! Will definitely help others with future debugging if needed.

It's worth noting i'm in a monorepo so there might be an issue with that?

Heres my tsconfig (just using one from another project, so nothing really intentionally configured)

{
  "compilerOptions": {
    "module": "commonjs",
    "rootDir": ".",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "target": "es2020",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false,
    "allowJs": true
  },
  "include": [
    "src/**/*",
    "libs/**/*"
  ],
  "exclude": ["node_modules"]
}

Node Version: 20.12.0

from embedjs.

adhityan avatar adhityan commented on August 26, 2024

Thanks for sharing the tsconfig. Did this ever work for you since then? I haven't tested the library with monorepos yet but I suppose I can take a look - but it will take a bit.

from embedjs.

adhityan avatar adhityan commented on August 26, 2024

I am closing this issue for now, feel free to reopen it if issue persists. I am planning to move the library itself to a monorepo setup in some time, this should make things easier I suppose.

from embedjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.