-
Notifications
You must be signed in to change notification settings - Fork 46
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
TS1479, helmet typings issue #210
Comments
Would our fancy nodenext triplet help? |
OK, I see https://github.com/fastify/fastify-helmet/pull/207/files |
with v10.0.2 and even earlier versions we get that error. Nothing todo with our nodenext changes. |
@kibertoad helmetjs/helmet#389 (comment)
|
Opened a PR to fix this issue upstream helmetjs/helmet#391 |
confirming it still persists node_modules/@fastify/helmet/types/index.d.ts:2:62 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("helmet")' call instead.
2 import helmet, { contentSecurityPolicy, HelmetOptions } from 'helmet';
|
I am going to lock this issue. Please do not open a new issue for the same problem. |
@EvanHahn fixed this issue in v6.1.0 of helmet. |
@Uzlopak should we bump minimum version? |
Prerequisites
Fastify version
4.10.2
Plugin version
10.1.0
Node.js version
16.17.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
22.04
Description
It seems that we get typescript errors, because the typings from helmet are ecmascript and not commonjs
Steps to Reproduce
clone https://github.com/Uzlopak/nodenext-mvce/tree/helmet-issue
npm run build
Expected Behavior
Should not throw
The text was updated successfully, but these errors were encountered: