-
Notifications
You must be signed in to change notification settings - Fork 31
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
error TS7016: Could not find a declaration file for module 'node-config-ts' #87
Comments
I will say that I have tried to create to do what google says and create a blank module inside a .d.ts file but that didnt work. The only thing that worked was to copy the config.d.ts to an index.d.ts inside the node_module folder. Also, I'm thinking there is something specific to cucumber that is causing it because the blank module trick worked in a different project I have and cucumber has a config file with module resolution: cucumber.mjs
|
I had to copy Config.ts.d to node_modules/node-config-ts/index.d.ts I know this is not supposed to be needed anymore, but it was for me today. |
Quick workaround is to use: |
The answer from @shayan-hussaini-10p worked for me, although I had to add a lint ignore on my project: // eslint-disable-next-line @typescript-eslint/no-var-requires
const { config } = require('node-config-ts') I get the same error:
I followed all the steps of the installation, but what it wasn't clear is what to do with "include": [
"src/**/*.ts",
"config/**/*.ts"
], But I don't know if this is the right way of setting up |
Anything more on this? I confirm that everything works as expected for version 2.3.1 but from there on I get this error. In tsconfig.json if I set strict to false then it runs. Note, that |
For now I am not setting strict to false in tsconfig but rather have modified the post install script to create a symbolic link - I don't know how this will effect build (I am using Vita) but at least I can run using nodemon shown above.
|
Any update on this? Getting the error as well, I am pretty sure this shouldn't happen. |
Describe the bug:
TSError: ⨯ Unable to compile TypeScript:
src/execution-scopes/test-run.ts(9,24): error TS7016: Could not find a declaration file for module 'node-config-ts'. 'C:/app/PaymentAppAutomation/node_modules/node-config-ts/index.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/node-config-ts
if it exists or add a new declaration (.d.ts) file containingdeclare module 'node-config-ts';
src/execution-scopes/test-run.ts(35,57): error TS7006: Parameter 'api' implicitly has an 'any' type.
src/execution-scopes/test-run.ts(38,57): error TS7006: Parameter 'api' implicitly has an 'any' type.
src/execution-scopes/test-run.ts(41,54): error TS7006: Parameter 'api' implicitly has an 'any' type.
src/execution-scopes/test-run.ts(44,57): error TS7006: Parameter 'api' implicitly has an 'any' type.
run.js:14
Steps To Reproduce:
run
npm i node-config-ts
. My version installed is 3.3.1Create default.json at /config and files under development
run
npm i
and see that Config.d.ts created at root of /configrun the application from VSCode via ctrl F5 and error above shown
Expected behavior:
No errors occur when application is run and configuration is populated correctly.
Typescript Version:
4.9.3
node-config-ts version:
3.3.1
tsconfig.json
package.json
Additional context
VSCode 1.75.1
Windows 10
The text was updated successfully, but these errors were encountered: