After researching the issue extensively, I came across various discussions on the typeorm
github repository. Unfortunately, all of them were closed without a definite solution provided. It appears to be related to a webpack
problem, but the exact nature of the issue eludes my understanding. Surprisingly, the example compiles perfectly fine for me.
The error occurs immediately upon calling createConnection
, an imported function from typeorm
. The error message I encounter is as follows (with parts of the paths excluded for brevity):
WARNING in ./node_modules/typeorm/platform/PlatformTools.js
Module not found: Error: Can't resolve 'redis' in '/my/project/node_modules/typeorm/platform'
@ ./node_modules/typeorm/platform/PlatformTools.js
@ ./node_modules/typeorm/index.js
@ ./src/main.ts
... Other similar warning and error messages follow ...
This error persists in my project setup. Here's a snippet of my package.json
file (some dependencies have been removed for clarity):
{
"name": "something-with-electron",
"version": "1.0.0",
... // Remaining package.json content
}
Additionally, here is my webpack.config.js
:
const path = require('path')
const HTMLWebpackPlugin = require('html-webpack-plugin');
... // Remaining webpack config content
If anyone has insights or suggestions regarding this issue, please feel free to share. Any assistance would be greatly appreciated!