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

"TypeError: RateLimit is not a constructor" when start the container #324

Open
planetoid opened this issue Jan 3, 2023 · 3 comments
Open

Comments

@planetoid
Copy link

Step 1: To build the container
I tried to install kort via Docker. First I met the error mesage after key in docker-compose build to build the container.

 > [5/6] RUN npm install --only=production:
#9 0.341 npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.
#9 2.375 npm ERR! code ERESOLVE
#9 2.377 npm ERR! ERESOLVE unable to resolve dependency tree
#9 2.377 npm ERR!
#9 2.378 npm ERR! While resolving: @carlsonp/kort@1.0.1
#9 2.378 npm ERR! Found: bootstrap@5.2.3
#9 2.378 npm ERR! node_modules/bootstrap
#9 2.378 npm ERR!   bootstrap@"^5.1.1" from the root project
#9 2.378 npm ERR!
#9 2.378 npm ERR! Could not resolve dependency:
#9 2.378 npm ERR! peer bootstrap@"^3.1.0 || ^4.4.0" from bootbox@5.5.3
#9 2.378 npm ERR! node_modules/bootbox
#9 2.378 npm ERR!   bootbox@"^5.5.2" from the root project
#9 2.379 npm ERR!
#9 2.379 npm ERR! Fix the upstream dependency conflict, or retry
#9 2.379 npm ERR! this command with --force or --legacy-peer-deps
#9 2.379 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
#9 2.379 npm ERR!
#9 2.379 npm ERR!
#9 2.379 npm ERR! For a full report see:
#9 2.379 npm ERR! /root/.npm/_logs/2023-01-03T07_27_33_374Z-eresolve-report.txt
#9 2.380
#9 2.380 npm ERR! A complete log of this run can be found in:
#9 2.381 npm ERR!     /root/.npm/_logs/2023-01-03T07_27_33_374Z-debug-0.log
------
executor failed running [/bin/sh -c npm install --only=production]: exit code: 1
ERROR: Service 'kort' failed to build : Build failed

I modified the file Dockerfile as following to pass the above error.

# RUN npm install --only=production
RUN npm install --only=production --legacy-peer-deps

Step 2: Start the container

I key in the command docker-compose up to start the containers, I met the following message:

kort     | /usr/src/kort/app.js:48
kort     | var limiter = new RateLimit({
kort     |               ^
kort     |
kort     | TypeError: RateLimit is not a constructor
kort     |     at Object.<anonymous> (/usr/src/kort/app.js:48:15)
kort     |     at Module._compile (node:internal/modules/cjs/loader:1218:14)
kort     |     at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
kort     |     at Module.load (node:internal/modules/cjs/loader:1081:32)
kort     |     at Module._load (node:internal/modules/cjs/loader:922:12)
kort     |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
kort     |     at node:internal/main/run_main_module:23:47
kort     |
kort     | Node.js v19.3.0
kort exited with code 1

My environment is

  • CentOS Linux release 7.9.2009 (Core)
  • Docker version 20.10.21, build baeda1f

Any idea to resolve the issue? Thanks for your time.

@carlsonp
Copy link
Owner

carlsonp commented Jan 3, 2023

Hello. We unfortunately haven't had the time to keep up on the dependency updates and build system for Kort for a number of years. There were a number of dependencies with updates which had breaking changes. I suspect you've run into one of those. We'd be happy to look at merging pull requests or any changes if you get things working.

@planetoid
Copy link
Author

Walk-around: I installed the tag v1.0.1 to bypass the dependency issue.

@carlsonp
Copy link
Owner

carlsonp commented Jan 4, 2023

Great to hear!

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