Currently, I am in the process of integrating TypeORM into my Next.js application. Despite utilizing the mysql2 driver and configuring 5 data sources, I am encountering a persistent BSON error:
./node_modules/typeorm/browser/driver/mongodb/bson.typings.js
Module parse failed: Export 'BSON' is not defined (1:9)
You may need an appropriate loader to handle this file type, as there are currently no loaders configured for it. Please visit https://webpack.js.org/concepts#loaders for more information.
> export { BSON };
|
| //# sourceMappingURL=bson.typings.js.map
This is the primary data source that I am attempting to utilize:
export const MI_Website = new DataSource({
type: "mysql",
host: process.env.BD_HOST as string,
port: parseInt(process.env.DB_PORT as string) || 3306,
username: process.env.DB_USERNAME as string,
password: process.env.DB_PASSWORD as string,
database: process.env.DB_DATABASE1 as string,
entities: [__dirname + "/entity/website/*{.jsx,.tsx,.js,.ts}"],
synchronize: true,
})
Any assistance with resolving this issue would be highly appreciated. Despite conducting thorough research, I have yet to come across any solutions to fix this problem.