JLuboff / connect-mssql-v2

MS SQL Server session store for Express Session
MIT License
5 stars 7 forks source link

require(...) is not a function #29

Closed Kellende closed 3 years ago

Kellende commented 3 years ago

I am getting this error after declaring like so: const express = require('express'); const session = require('express-session'); const MSSQLStore = require('connect-mssql-v2')(session); // here

And using like so: app.use(session({ store: new MSSQLStore(config), secret: 'XXXXX', resave: false, saveUninitialized: true }));

And am getting the error: TypeError: require(...) is not a function on the line marked "here." Am I doing something wrong?

JLuboff commented 3 years ago

Can you create a codesandbox or something similar to show this? I just threw together a file with just express-session and connect-mssql-v2 and am not getting the TypeError.

Kellende commented 3 years ago

Sorry, it is working now. Having some connection errors but I think that is scoping issues on my part, I'm still new at JavaScript. Thanks for the quick reply and for the awesome work, makes my life a lot easier.

JLuboff commented 3 years ago

@Kellende Another user had the same error and we were able to resolve it via the most recent version (v1.6.3).

Kellende commented 3 years ago

Thank you!

On Wed, Oct 7, 2020, 5:21 PM Jason Luboff notifications@github.com wrote:

@Kellende https://github.com/Kellende Another user had the same error and we were able to resolve it via the most recent version (v1.6.3).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JLuboff/connect-mssql-v2/issues/29#issuecomment-705243296, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQUBIIBRMG56L6BY3YC3ULTSJTZWLANCNFSM4R35Z7MQ .

-- This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential, privileged, and/or proprietary information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited.

If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments).