Closed dervaux closed 2 years ago
Don't use module.exports. prepend your function declaration with export
instead. export async function up(sql) {
Yes, @jgod is correct here. I'm just noticing that the readme is missing a full TS example, sorry about that. Your snippet should look like this:
import { Client } from 'postgres';
export async function up(sql: Client) {
await sql`...`;
}
And sorry about the delay, I don't know how/why I missed this for so long 😕
Dear @lukeed, I've been trying to implement ley with Typescript. After following your documentation and implementing this issue's solution: https://github.com/lukeed/ley/issues/13, I'm still getting this ts error message:
'1624547133-create-users-table.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.ts(1208) var exports: any
Any idea about what could be missing here?