Getting webstorm to run with sequelize or recognising externals in webpack or I'm an idiot

Hi

Really hope someone can help.

I'll try to be succinct here. I'm trying to work with the sequelize (SQL ORM) module, but it just won't compile. After installation of sequelize and adding the dependency for mariadb via npm i've coded some stuff up. On running I hit a Fail To Compile issue:  "Module not found: Can't resolve 'pg-hstore'..."  I don't need that dependency since i'm not using postgresql. That's not just me saying that - it isn't needed.

The issue is actually mentioned in many discussions e.g. here:  https://github.com/sequelize/sequelize/issues/7509

The 'fixes' all centre around setting these modules in the externals part of the webpack config. Great...except I didn't have one. So I created one and put it at the top level of my (react) project. I just did pretty much as per one of the comments:

var nodeExternals = require('webpack-node-externals'); // which i installed through npm

const path = require('path'); // no idea whether this is needed

module.exports = { target: 'node', externals: [ nodeExternals(), ["pg", sqlite3", "tedious", "pg-hstore"]] };

The webstorm console said that' module resolution rules from webpack.config.js are now used for coding assistance' but guess what, it didn't make a difference. Still getting the same compile error  'Can't resolve pg-hstore'

So my basic question is - how do i get webstorm to set these as externals? (or alternatively, has anyone got sequelize to work in webstorm and if so , how did they do it).

Honestly, i'm about to give up on sequelize, what am i doing wrong? 

thanks!

 

 

 

 

1 comment

Sorry, but your problem has absolutely nothing to do with WebStorm. I'd suggest asking this question at https://github.com/sequelize/sequelize/issues/7509

0

Please sign in to leave a comment.