Garret Harp
08/11/2021, 3:56 AM(0 , import_uuid.version) is not a function
anyone know how to fix this? I tried setting it in the nodeModules array on the function bundle but that did not changing anything.Frank
uuid
npm package?Frank
Garret Harp
08/11/2021, 3:58 AMimport { version as uuidVersion } from 'uuid'
export const validateUuidV4 = (uuid: string) => {
const v = uuidVersion(uuid)
if (v !== 4) {
throw new TypeError('Invalid id value')
}
}
Frank
Garret Harp
08/11/2021, 4:02 AMGarret Harp
08/11/2021, 4:04 AMGarret Harp
08/11/2021, 4:05 AMversion
because I can use v4
just fine and create a uuid.Garret Harp
08/11/2021, 4:07 AMFrank
Frank
import { APIGatewayProxyResult } from "aws-lambda";
import { version as uuidVersion } from 'uuid'
export async function main(): Promise<APIGatewayProxyResult> {
uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003');
return {
statusCode: 200,
body: "hello",
};
}
Frank
bundle.nodeModules
, but that’s not relevant to this errorGarret Harp
08/11/2021, 4:15 AMFrank
Garret Harp
08/11/2021, 4:16 AMGarret Harp
08/11/2021, 4:17 AMGarret Harp
08/11/2021, 4:18 AMFrank
bundle
option. It makes ur build slower.