typeorm: Sqlite driver in Webpack/Electron on 0.2.28: (TypeError): this.driver.connect is not a function
Issue type:
[x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[x] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
0.2.28
Steps to reproduce or a small repository showing the problem:
Clone the reproduction repo at https://github.com/jjhbw/typeorm-webpack-electron-repro
See simple instructions on how to trigger the error in the repo’s README.
Note that the invocation of createConnection resides in src/App.js.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (15 by maintainers)
Commits related to this issue
- Removed the browser entrypoint as a workaround for issue https://github.com/typeorm/typeorm/issues/6854 — committed to jjhbw/typeorm by jjhbw 4 years ago
- Removed the Sqlite driver browser entrypoint as a workaround for issue https://github.com/typeorm/typeorm/issues/6854 — committed to jjhbw/typeorm by jjhbw 4 years ago
@dominicdesu @jjhbw First sorry for my english kk, i am creating an application using vue and electron and encountered the same problem, i solved this with folow config in webpack
My solution was this and electron builder config, for you this solution should solve. The original webpack documentation: https://webpack.js.org/configuration/externals/#externals The issue where encountered the solution for my problem: https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/699
Yes, i’m aware. Hence my snark regarding the hypothetical devs who try to use it in a browser context. 😉
Ah, that makes sense. Did not think of that case. In light of that, I’d say you’re right not to accommodate this in TypeORM… I guess the only way is to get Webpack to fix the mainFields issue instead.
Thanks for the time you spend on this library! Much appreciated.