On my Node.js app I have installed @pinecone-database/pinecone@0.0.10
along with langchain
, whenever I have PineconeClient
imported, Jasmine tests fail reporting: [TypeError: Cannot read properties of undefined (reading 'match')]
. When I comment out the import statement my tests just run fine.
Has anyone fixed this error?
Reproduction
- In Node.js environment:
install -S dotenv langchain @pinecone-database/pinecone jasmine
- In package.json add:
"type": "module"
- Initialize Jasmine:
npx jasmine init
- Create a .js file to import PineconeClient:
touch test.js
- In
test.js
import PineconeClient:import { PineconeClient } from "@pinecone-database/pinecone";
inside test.js:
// test.js
import { PineconeClient } from "@pinecone-database/pinecone";
export async function foo() {
console.log("test");
}
- Create test.spec.js in
specs/
:
// test.spec.js
import { foo } from '../test.js'
describe('test', () => {
it('does something', async () => {
expect(1).toBe(1);
})
})
- run
npx jasmine