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

[@types/serve-static] Cannot use namespace 'HttpError' as a type? #68208

Open
PuneetKohli opened this issue Jan 15, 2024 Discussed in #68194 · 6 comments
Open

[@types/serve-static] Cannot use namespace 'HttpError' as a type? #68208

PuneetKohli opened this issue Jan 15, 2024 Discussed in #68194 · 6 comments

Comments

@PuneetKohli
Copy link

Discussed in #68194

Originally posted by jeffysam6 January 14, 2024
I keep getting this error on "npm run build" from this particular file
node_modules/@types/serve-static/index.d.ts:98:67 - error TS2709: Cannot use namespace 'HttpError' as a type.

Node version : 18

The two libraries dependent on serve-static in my dependencies are firebase-functions and express

This is my package.json

{
  "name": "functions",
  "scripts": {
    "lint": "eslint \"src/**/*\"",
    "build": "tsc",
    "build:watch": "tsc --watch --preserveWatchOutput",
    "build:prod": "npm run build",
    "serve": "npm run build:watch | firebase emulators:start",
    "stop": "npx kill-port 9099 5001 8080 9000 5000 8085 7090 9199",
    "dev": "npm run build -- --watch | firebase emulators:start",
    "dev:data": "npm run build -- --watch | firebase emulators:start --inspect-functions --import ../db_may_14_2022",
    "serve:functions": "npm run build && firebase emulators:start --only functions",
    "functions:watch": "npm run build:watch && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "test": "jest",
    "deploy": "npm run build && firebase deploy --only functions",
    "logs": "firebase functions:log",
    "prettify": "prettier --write \"src/**/*.ts\"",
    "lint:eslint": "eslint --ignore-path .gitignore",
    "lint:eslint:fix": "eslint --ignore-path .gitignore --fix",
    "lint:staged": "lint-staged"
  },
  "lint-staged": {
    "*.ts": [
      "npm run lint:eslint:fix",
      "prettier --write",
      "git add --force"
    ],
    "*.js": [
      "npm run lint:eslint:fix",
      "prettier --write",
      "git add --force"
    ],
    "*.json": [
      "prettier --write",
      "git add --force"
    ]
  },
  "pre-commit": "lint:staged",
  "engines": {
    "node": "18"
  },
  "main": "lib/index.js",
  "dependencies": {
    "@dqbd/tiktoken": "^1.0.7",
    "@faker-js/faker": "^7.6.0",
    "@firestore-simple/admin": "^7.0.5",
    "@google-cloud/bigquery": "^5.9.2",
    "@google-cloud/firestore": "^4.3.0",
    "@google-cloud/logging-winston": "^4.1.1",
    "@langchain/openai": "^0.0.11",
    "@sentry/node": "^7.35.0",
    "@sentry/tracing": "^7.35.0",
    "@types/cors": "^2.8.9",
    "@types/serve-static": "^1.15.5",
    "@types/stripe": "^8.0.417",
    "aws-sdk": "^2.841.0",
    "axios": "^0.21.4",
    "axios-retry": "^3.5.0",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.1",
    "cls-hooked": "^4.2.2",
    "cls-rtracer": "^2.6.0",
    "compromise": "^14.10.0",
    "cookie-parser": "^1.4.5",
    "cors": "^2.8.5",
    "csv-writer": "^1.6.0",
    "csvtojson": "^2.0.10",
    "exponential-backoff": "^3.1.1",
    "express": "^4.18.2",
    "faiss-node": "^0.2.2",
    "firebase-admin": "^9.5.0",
    "firebase-functions": "^3.24.1",
    "firebase-tools": "^10.2.0",
    "firestore-export-import": "^1.1.0",
    "googleapis": "^126.0.1",
    "html-pdf-node": "^1.0.8",
    "http-errors": "^2.0.0",
    "jwt-decode": "^3.1.2",
    "langchain": "^0.1.2",
    "langsmith": "^0.0.57",
    "moment": "^2.29.1",
    "morgan": "^1.10.0",
    "nodemailer": "^6.4.17",
    "openai": "^3.2.1",
    "pdf.js-extract": "^0.1.5",
    "pdfkit": "^0.13.0",
    "query-string": "^7.0.1",
    "raw-body": "^2.4.1",
    "simple-spellchecker": "^1.0.2",
    "slack-notify": "^2.0.6",
    "stripe": "^12.6.0",
    "tiktoken": "^1.0.10",
    "uuid": "^8.3.2",
    "winston": "^3.3.3"
  },
  "devDependencies": {
    "@babel/cli": "^7.22.5",
    "@babel/core": "^7.22.5",
    "@babel/node": "^7.22.5",
    "@babel/preset-env": "^7.22.5",
    "@faker-js/faker": "^7.6.0",
    "@types/aws-sdk": "^2.7.0",
    "@types/babel__core": "7.1.18",
    "@types/babel__traverse": "7.14.2",
    "@types/cookie-parser": "^1.4.2",
    "@types/express": "^4.17.21",
    "@types/morgan": "^1.9.2",
    "@types/node": "^14.14.25",
    "@types/nodemailer": "^6.4.0",
    "@types/uuid": "^8.3.0",
    "@types/validator": "^13.7.1",
    "@typescript-eslint/eslint-plugin": "^3.9.1",
    "@typescript-eslint/parser": "^3.8.0",
    "cross-env": "^7.0.3",
    "eslint": "^7.19.0",
    "eslint-plugin-import": "^2.22.0",
    "firebase-functions-test": "^0.2.0",
    "lint-staged": "^12.3.4",
    "pre-commit": "^1.2.2",
    "prettier": "^2.5.1",
    "typescript": "^5.3.3"
  },
  "private": true
}
@PuneetKohli
Copy link
Author

PuneetKohli commented Jan 15, 2024

@benasher44 Appreciate if you could take a look!

@benasher44
Copy link
Contributor

benasher44 commented Jan 15, 2024

@PuneetKohli why me? I'm not a maintainer of these types, and this doesn't look connected to types I've updated recently (e.g. validator). Could you clarify why me? Maybe I'm misunderstanding though

@PuneetKohli
Copy link
Author

Saw you recently helped resolve a somewhat similar-looking issue (#68152) in [@types]/validator. If you are able to help that'd be great! Otherwise, please let me know the right maintainers to tag :)

@PuneetKohli
Copy link
Author

PuneetKohli commented Jan 15, 2024

(Been grappling with this issue a few days now, as we don't use these libraries directly, it's a dependency from express and firebase-functions, and it's completely blocked from moving forward w/ other packages we are trying to use. The issue comes up when we upgrade typescript.)

@benasher44
Copy link
Contributor

Ah i see. While both issues deal with namespaces, this one is different. If you file this via discussions, the bot will automatically tag the right maintainers.

@PuneetKohli
Copy link
Author

Appreciate the help: @urossmolnik, @LinusU, @devanshj.

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