Hello! I'm starting to use Bun and have gotten most of the setup finished. However, when running bun build src/index.ts --outdir dist/index.js --target bun and then running bun run dist/index.js, I get an error saying TypeError: undefined is not an object (near '...(function () { })...'). I don't get this error when compiling using tsc, so I'm a bit confused as to why I'm getting errors compiling to Bun. The error points to a class where I extend to another class like this:
export default class NineAnime extends AnimeProvider {
// Attributes
}
In the built index.js file, the line where the error is thrown is like this:
class NineAnime extends AnimeProvider {
// Attributes
}
All my code is open sourced here, with the main class where the error is thrown here.
Personal Analysis
I think the error might be due to circular dependencies since Bun compiles into one singular file whereas tsc compiles to a ./dist folder with multiple files. I'm wondering if there is a fix the Bun community has found or if it's possible to do bun build and output multiple files rather than just one.