Skip to content

Commit 81848bc

Browse files
authored
fix(security/helmet): add info about import error
1 parent 3311ef0 commit 81848bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/security/helmet.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import helmet from 'helmet';
2020
app.use(helmet());
2121
```
2222

23+
> info **Hint** If you are getting a error (`TypeError: helmet_1.default is not a function`) while trying to import Helmet, you will need to set `allowSyntheticDefaultImports` and `esModuleInterop` to `true` in your project's `tsconfig.json`. Another solution is to import `Helmet` using `import * as helmet from 'helmet'`.
24+
2325
#### Use with Fastify
2426

2527
If you are using the `FastifyAdapter`, install the [fastify-helmet](https://github.com/fastify/fastify-helmet) package:

0 commit comments

Comments
 (0)