Closed mystist closed 1 year ago
In my case, I need to change import path into this in package.json file:
"./src/utils": {
"types": "./types/utils/index.d.ts",
"default": "./src/utils/index.js"
},
Instead of
"./utils": {
"types": "./types/utils/index.d.ts",
"default": "./src/utils/index.js"
},
Hi @Mystist, make sure you're on the latest version of package (0.1.4). You shouldn't need to change exports
.
@ankane Issue still, I can confirm that I am with the latest version.
FYI. I am import it from a service of a Nestjs application:
import pgvector from 'pgvector/src/utils'
And here is my tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
}
}
The import statement should be:
import pgvector from 'pgvector/utils';
import pgvector from 'pgvector/utils';
It was this value in the beginning when I tried this. That's not the point, actually the code are fairly simple and I can copy/paste it as it is in my codebase.
Thanks for your great work!
Can confirm this doesnt work for me either, using 0.14 of the library.
Cannot find module 'pgvector/utils' or its corresponding type declarations.ts(2307)
The import statement should be:
import pgvector from 'pgvector/utils';
FYI this also doesn't work for me, using the latest 0.1.4 version. Like the above commenters, I can only import from "pgvector/src/utils".
Hi all, previous releases required moduleResolution
to be set to node16
/nodenext
. Version 0.1.5 now supports node
, which should fix the import errors.
error TS2307: Cannot find module 'pgvector/utils' or its corresponding type declarations.
3 import pgvector from 'pgvector/utils'