choutianxius / lucia-adapter-dynamodb

A DynamoDB adapter for lucia-auth
MIT License
3 stars 2 forks source link

No matching export #6

Open schwjustin opened 4 days ago

schwjustin commented 4 days ago

× utils/auth.ts:5:9: No matching export in "../../node_modules/.pnpm/lucia-adapter-dynamodb@2.1.0_lucia@3.2.0/node_modules/lucia-adapter-dynamodb/dist/index.d.ts" for import "DynamoDBAdapter

package.json:

{
    ...
    "dependencies": {
        ...
        "lucia": "^3.2.0",
        "lucia-adapter-dynamodb": "^2.1.0",
        "oslo": "^1.2.0",
        "ulid": "^2.3.0"
    }
}

auth.ts:

import { Lucia } from "lucia";
import { DynamoDBAdapter } from "lucia-adapter-dynamodb";
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";

export const dynamoDBClient = new DynamoDBClient({
    credentials: {
        accessKeyId: "xxx",
        secretAccessKey: "verysecret",
    },
    region: "xx-xx-#",
});

export const dynamoDBAdapter = new DynamoDBAdapter(dynamoDBClient, {
    tableName: "AuthTable", 
    pk: "PK",
    sk: "SK",
    gsi1Name: "GSI1",
    gsi1pk: "GSI1PK",
    gsi1sk: "GSI1SK",
    gsi2Name: "GSI2",
    gsi2pk: "GSI2PK",
    gsi2sk: "GSI2SK",
});
schwjustin commented 4 days ago

using import { DynamoDBAdapter } from "lucia-adapter-dynamodb/dist"; fixed it but I'm not sure that's expected

choutianxius commented 4 days ago

Hi @schwjustin , I published a new version (2.2.0) to update the Lucia version. Please try if that solves the issue

schwjustin commented 4 days ago

I get the same error unfortunately. I'm using this with SST Ion

schwjustin commented 4 days ago

with /dist it works just fine

choutianxius commented 4 days ago

with /dist it works just fine

Yes, since the index.js and index.d.ts files are inside that folder.

I found a problem in the previous package.json file where the types field was not properly set, and published a new version (v2.2.1) to fix that. Please try if that one solves the issue. Also please try reset the node_modules folder to clear previous versions.