Skip to content

Commit 9da0d34

Browse files
coyoteecdpleerock
authored andcommitted
fix: load typeorm-aurora-data-api-driver correctly when using webpack (#4788) (#5302)
TypeORM uses require() within PlatformTools to load driver packages. The typeorm-aurora-data-api-driver is exported with export default and packaged with rollup, which, as per webpack/webpack#4742, causes the require'd module to be available via require('typeorm-aurora-data-api-driver').default property.
1 parent 10bcc82 commit 9da0d34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/driver/aurora-data-api/AuroraDataApiDriver.ts

+4
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,10 @@ export class AuroraDataApiDriver implements Driver {
761761
*/
762762
protected loadDependencies(): void {
763763
this.DataApiDriver = PlatformTools.load("typeorm-aurora-data-api-driver");
764+
765+
// Driver uses rollup for publishing, which has issues when using typeorm in combination with webpack
766+
// See https://github.com/webpack/webpack/issues/4742#issuecomment-295556787
767+
this.DataApiDriver = this.DataApiDriver.default || this.DataApiDriver;
764768
}
765769

766770
/**

0 commit comments

Comments
 (0)