Try modifying you index.ts
file to this:
index.ts
import { CustomError } from "path/to/CustomError.ts";
import { NotFoundError } from "path/to/NotFoundError.ts";
export { CustomError, NotFoundError };
You can refer a index.ts
file of my project which aims to do the same: https://github.com/Jay-Karia/jqlite/blob/main/src/index.ts