'Webpackmissingmodule when trying to import sequelize
I have the following error when trying to import sequelize
Uncaught Error: Cannot find module 'url' at webpackMissingModule (sequelize.js:21:21) at Object../node_modules/sequelize/dist/lib/sequelize.js (sequelize.js:21:21) at webpack_require (bootstrap:19:1) at Object../node_modules/sequelize/dist/index.js (index.js:2:1) at webpack_require (bootstrap:19:1) at Module../node_modules/sequelize/dist/index.mjs (setPrototypeOf.js:8:1) at webpack_require (bootstrap:19:1) at Module../db/databaseconnector.js (startsection.js:45:1) at webpack_require (bootstrap:19:1) at Object../app.js (app.js:21:19)
My webpack.config.js looks like this:
module.exports = {
mode: "development",
devtool: 'source-map',
entry: "./main.tsx",
output: {
filename: "./app-bundle.js"
},
resolve: {
extensions: ['.Webpack.js', '.web.js', '.ts', '.js', '.jsx', '.tsx']
},
module: {
rules: [
{
test: /\.tsx$/,
exclude: [/(node_modules|bower_components)/, /node_modules/],
use: {
loader: 'ts-loader'
}
},
{
test: /\.(s(a|c)ss)$/, //this is important to specify what to load and what to test against
use: ['style-loader', 'css-loader', 'sass-loader']
}
]
}
}
Anyone know what the problem could be or has encountered this before?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
