Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library is breaking tests: can't find module 'uuid/v1' in sequelize utilities #29

Open
dansundy opened this issue Jan 27, 2021 · 1 comment

Comments

@dansundy
Copy link

I'd love to use this library but it is breaking my tests with the following error:

Cannot find module 'uuid/v1' from 'node_modules/sequelize/lib/utils.js'

Require stack:
      node_modules/sequelize/lib/utils.js
      node_modules/sequelize/lib/sequelize.js
      node_modules/sequelize/index.js
      node_modules/koa2-ratelimit/src/SequelizeStore.js
      node_modules/koa2-ratelimit/src/index.js
      server/server.js
      server/heartbeat/__tests__/heartbeat-requests.test.js

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (node_modules/sequelize/lib/utils.js:6:16)

This happens as soon as I require the module in my app:

const rateLimit = require('koa2-ratelimit').RateLimit

This is how I'm using it in my server.js file:

app.use(
  rateLimit.middleware({
    interval: { min: 15 }, // 15 minutes = 15*60*1000
    max: 100, // limit each IP to 100 requests per interval
  })
)

I am not using a store. For now I am conditionally adding the block for production but I'm wondering why sequelize is being added at all if I'm not using it.

Thanks for your time!

@julienwilmet
Copy link
Contributor

Is this still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants