helmetjs / helmet

Help secure Express apps with various HTTP headers

Home Page:https://helmetjs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while building on local and digital ocean space

rashedulislam opened this issue · comments

I have a project setup where i have used NextJs on frontend and express in backend
While using using helmet for backend security headers following error thrown.

11:20 - error TS7016: Could not find a declaration file for module 'helmet'. '/.../node_modules/helmet/index.cjs' implicitly has an 'any' type.

Note: I have added @types/helmet as dev dependency

While deploying on digital ocean space it was throwing another error "tsc" not found. I was building through this command
npx tsc -p server && next build

commented

I had a similar issue on one of my projects, I was going to make a test project for this issue but figured out it was an issue with an old TypeScript version. For me, using typescript@4.6.4 and helmet@>=6.1.1 failed, but upgrading TS to 4.7.2 fixed the issue for me.

There hasn't been activity on this issue in awhile and I think it's resolved, so I'm going to close.

If that's wrong, I'm happy to reopen this issue.